-
-
Notifications
You must be signed in to change notification settings - Fork 674
PEP8 and typing annotations for function fields #40972
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
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit 140807b; changes) is ready! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but please next time:
- do no make any change about spaces around arithmetic operators ;
- rather do only annotations changes, when changing so many files
- I would also prefer to avoid Literal for the moment
Thanks for the review!
I can certainly do that, but can I ask why you don't like the spaces around arithmetic operators? Do you not like spaces around operators, or is it just too annoying to review for how minor of a fix it is?
For sure! Originally I was not planning to change this many files but I guess I got carried away.
Sure. There aren't many places where we can use it anyway since it only works with Python literals. Something like The reason I wanted to use def constant_false() -> Literal[False]:
return False The hope was that if a Cython file imported if constant_false():
assert False that the if statement would be optimized out. Unfortunately, at least as far as I can tell, it isn't currently optimized out. |
Mostly done with
ruff
andautotyping
, but also some manually for the main function field classes.📝 Checklist
⌛ Dependencies