This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Use mypy 1.0 #15052
Merged
Merged
Use mypy 1.0 #15052
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
325daae
Update mypy and mypy-zope
408935c
Suppress false positives from modules not implementing Protocols
d584aeb
Remove unused ignores
07d96ca
Avoid empty body warnings
1f00d57
Suppress false positive about `JaegerConfig`
57861a8
Fix not calling `is_state()`
9d1d8a6
Suppress false positives from ParamSpecs
b63789a
Drive-by improvement to `wrapping_logic` annotation
212897e
Workaround false "unreachable" positives
a7c2bc3
Changelog
852b3fc
Linter fixes
8395cc8
Make UserInteractiveAuthChecker an ABC
f351967
Make Responder an ABC
29dd442
Mark EventSource as an ABC
e9329dc
Tweak DBAPI2 Protocol to be accepted by mypy 1.0
029cfaf
Pull in updated canonicaljson lib
14db7d4
Improve comments in opentracing
b739beb
Better annotation for INTERACTIVE_AUTH_CHECKERS
7612a88
Drive-by AUTH_TYPE annotation, to remove an ignore
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Improve type hints. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is there a way to make it think it is concrete? This seems like using any sort of
abstractmethod
, etc. would...just not work with mypy?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.
There is a way---thanks for pressing me on this.
Without any annotation,
INTERACTIVE_AUTH_CHECKERS
is inferred to have typeList[Callable[[HomeServer], UserInteractiveAuthChecker]]
.Making it
List[Type[UserInteractiveAuthChecker]]
seems to do the right thing (though I usedSequence
because I don't want to suggest it the list of checkers should be mutable).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.
That makes sense -- we're instantiating them here so it should definitely be
Type[UserInteractiveAuthChecker]
. It seems we had made this mistake quite a bit in the early days...