-
-
Notifications
You must be signed in to change notification settings - Fork 385
Make evolve 1st arg positional-only #1109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Wow that's gross :D – I wonder if that's possible to express for typing? It would probably break some people who passed it as keyword arguments… 🤔 |
attrs has type stubs so the way it looks to typing can be modern w/PEP-570. Also, recently I've merged python/mypy#14526 where you can provide the instance only positionally, so in attrs it will be positional only from the next release due to plugin code. |
Dataclasses did something similar, albeit with warning and not a breaking change. Maybe we want to do the same: https://bugs.python.org/issue37163 |
FWIW, they did break later as announced in the issue:
guess we could warn now and break in a year. |
It's arbitrary that the 1st argument is named
inst
and could conflict with a field.Since PEP-570 positional-only arguments require Python 3.8 and next major version will be ≥ Python 3.7, we can do it the old-fashion way in the next breaking version (as this is an API change), i.e.
The text was updated successfully, but these errors were encountered: