| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| __slots__ = ["seconds", "nanoseconds"] | ||
|
|
||
| def __init__(self, seconds, nanoseconds=0): | ||
| def __init__(self, seconds: int, nanoseconds=0): |
There was a problem hiding this comment.
Shouldn't this also have typing for nanoseconds? Or are you deliberately not adding type annotations where the type can be deduced maybe?
I'm asking because I believe e.g. mypy wouldn't like this (partial type hinting in function definitions)
Sorry, something went wrong.
There was a problem hiding this comment.
My typing is intended for VS Code's (and maybe other editors') auto complete, so I didn't add type annotations where the type can be deduced.
Sorry, something went wrong.
There was a problem hiding this comment.
FWIW if you're planning to get this merged, I'd highly recommend to go ahead and fully type it, even for things that pyright (which VSCode uses) can infer -- it'll probably be helpful to more people and is only marginally more work!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Add Python 3.10-style typing for msgpack-python.
Compared to sbdchd/msgpack-types and #404, this PR added typing for all Python codes.
Closes #448