-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
TYP: annotation of __init__ return type (PEP 484) (pandas/plotting) #46283
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,7 +521,7 @@ class _Options(dict): | |
_ALIASES = {"x_compat": "xaxis.compat"} | ||
_DEFAULT_KEYS = ["xaxis.compat"] | ||
|
||
def __init__(self, deprecated=False): | ||
def __init__(self, deprecated=False) -> None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as long as you're doing these can you try to annotate other things in these signatures There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No problem, I think I can do it in separate PR as long as these are for fixing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, let's maybe keep the scope here limited to the return type of __init__ since if there is consensus on #46337, there will be quite a bit to do (if not done in one big PR, #46337 (comment)) |
||
self._deprecated = deprecated | ||
super().__setitem__("xaxis.compat", False) | ||
|
||
|
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.
I am pretty sure that not annotating this was a deliberate decision in the past.
cc @simonjayhawkins did this change over the last few weeks?
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.
As far as I can see, this line was added on 03/07/2019(#27009) without any additional comments. And this line also has not changed since those times.
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.
I am talking about init returning None in general
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.
Simon mentioned this in #44677 (comment)