-
-
Notifications
You must be signed in to change notification settings - Fork 392
Typing SocketType, test_socket, test_highlevel_[socket, open_tcp_stream, open_tcp_listeners] #2774
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fbae13d
wip
jakkdl 1a38b7e
wip2
jakkdl 201da1a
hide methods in SocketType behind a TYPE_CHECKING guard, update _io_k…
jakkdl 6cd3da7
Merge remote-tracking branch 'origin/master' into typing_sockettype
jakkdl c8fc73c
remove unneeded pragma: no cover
jakkdl e3fc6ae
fix default parameters
jakkdl 15e8351
Merge remote-tracking branch 'origin/master' into typing_sockettype
jakkdl d60d1a1
raise NotImplementedError instead of methods not being defined at
jakkdl b213602
remove docs reference
jakkdl 7eb099d
experimentally changing SocketType to be a generic
jakkdl ab66937
fix url
jakkdl 304fd32
fix old imports
jakkdl c36958c
Merge remote-tracking branch 'origin/master' into typing_sockettype
jakkdl 920d663
fix verify_types
jakkdl a3169cc
reverse making SocketType generic, CI fixes
jakkdl b9bbc06
fix verifytypes
jakkdl 76ab994
fix suggestions from teamspen
jakkdl ea36fe8
Merge remote-tracking branch 'origin/master' into typing_sockettype
jakkdl 0c294ea
Update `verify_types`
CoolCat467 dc09e7e
clarifying comments after a5rocks review
jakkdl 11cfd4e
Merge remote-tracking branch 'origin/master' into typing_sockettype
jakkdl d934724
fix verify_types ............
jakkdl 7335184
add @_public to exclude_lines in coveragerc
jakkdl 618fdbf
Revert "add @_public to exclude_lines in coveragerc"
jakkdl a20a909
'pragma: no cover' an added type-converting line
jakkdl 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
I didn't want these types to be
| None, as that affects the signature of all subclasses of SocketFactory. But this is a change in behaviour, so it might be better to just do atype: ignoreThere 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 think having them default to the values they would have became originally is a good thing
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 think this is fine. I approach type hints as not bound by semver (i.e. can narrow them or expand them as long as we're not passing something with a new type in) and subclasses can still default to
None. Hopefully that approach is sane...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.
the issue is not the type hint, but the default value being changed from
None -> socket.AF_INETetc etc.although thinking about it a bit more, I'm having trouble coming up with any code that actually changes in behaviour from this. If you're subclassing
SocketFactoryand defining your ownSocketFactory.socket, the default values inSocketFactory.socketshouldn't modify the behaviour ofMyClass.socketin any way .. I think?