GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — Add typing in Python code by peasoft · Pull Request #660 · msgpack/msgpack-python Conversation
|
| __slots__ = ["seconds", "nanoseconds"] | ||
|
|
||
| def __init__(self, seconds, nanoseconds=0): | ||
| def __init__(self, seconds: int, nanoseconds=0): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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 an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
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.
There was an error while loading. Please reload this page.
|
@copilot resolve the merge conflicts in this pull request |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Adding type stubs
There was an error while loading. Please reload this page.