| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This reverts commit deb623e.
|
I'm not a huge fan of this for two reasons:
Fixing the first one is relatively easy, only add builtins if a name in builtins is a field name, I'll give the second a go so this can also be version conditional in the future. |
Sorry, something went wrong.
|
I've opened an issue on the bpo https://bugs.python.org/issue45946 about this. |
Sorry, something went wrong.
|
Sorry, something went wrong.
|
I'm saying in an ideal world this shouldn't be fixed by us but by cpython. |
Sorry, something went wrong.
|
Can you also add a test for this? |
Sorry, something went wrong.
|
Assuming tests pass this looks much better than the original solution to this. Thank you! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Defining a dataclass with a field that its name is identical to its type name, and is initialized as a field produces RecursionError:
from dataclasses import dataclass, field @dataclass class Foo: bool: bool = field()This PR suggests a solution to the problem by using built-in types from the builtins package, so the above code will be changed to:
This PR also reverts #226 because it is solving a more general problem.