-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Core typing: sendrecv.py #3059
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
Core typing: sendrecv.py #3059
Conversation
fb970b3
to
b6c19ac
Compare
6e04815
to
b645b93
Compare
Codecov Report
@@ Coverage Diff @@
## master #3059 +/- ##
==========================================
- Coverage 85.36% 85.35% -0.01%
==========================================
Files 256 256
Lines 54191 54226 +35
==========================================
+ Hits 46258 46283 +25
- Misses 7933 7943 +10
|
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.
This is ready for review. Among other things, this PR discovered:
- fix "Bad number of arguments" type of issues on
PcapReader
& cie. - type overloading of some utils: remove several cast
- fix *args being misplaced (x2)
- add some doc for sendrecv functions
- fix
select_func
being called with inconsistent types (dict or lists) - fix an edge case in
AsyncSniffer
which could result inself.thread.start()
being called withself.thread = None
- remove unused variables in some
sendrecv
functions - remove compat.py from sphinx generation: see the commit for an explanation. Basically there's a builtin docstring in the
typing
module that is wrong, and that we can't fix.
This however still requires #3055 to be merged first
@overload | ||
def get_temp_file(keep, autoext, fd): | ||
# type: (bool, str, Literal[True]) -> IO[bytes] | ||
pass |
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.
This is pretty cool
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.
Agree!
Sphinx raises a warning on `typing.overload` that we cannot fix, because it's related to a dependency that is builtin :/
b645b93
to
a1066ea
Compare
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'll carefully read through this PR. I couldn't find any issue.
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.
LGTM, great work again!
@guedou Your call |
This PR:
sendrecv.py
Needs: #3055This is one of the last extremly big & annoying PRs of this kind. There are several parts left but none this central.