-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[clean-strict-optional] Clean-up the type checking files #3957
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
178ad41
9d77fbc
1f73106
218253a
d461fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,7 +112,7 @@ def __init__(self, name: str, suite: 'Optional[Suite]' = None, | |
self.name = name | ||
self.suite = suite | ||
self.old_cwd = None # type: Optional[str] | ||
self.tmpdir = None # type: Optional[tempfile.TemporaryDirectory] | ||
self.tmpdir = None # type: Optional[tempfile.TemporaryDirectory[str]] | ||
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. Totally off-topic: this would be a case where if you converted it to PEP 526 style ( 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. Yes, this is a good case for PEP 563. 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. This has surfaced in #5087 during self-check:
How did that pass before? |
||
|
||
def run(self) -> None: | ||
if self.func: | ||
|
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.
Wow, was that a bug?
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.
Indeed. I recall fixing it in at some point, but probably only on a local branch.
The reason it hadn't surface (AFAIK) is that it requires an overloaded method with generic self that's also has as bound a supertype of the class, without overlapping the other overload. This ish is a rare combination which is hard to get right anyway, and the checking for the "being a supertype" part is too strict in the case of overload, so I actually struggle to make an example where this is the only error.
result:
Adding a valid overload is not obvious (to me).