-
Notifications
You must be signed in to change notification settings - Fork 84
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
(Partially) add type hints. See #309. #391
Conversation
e3cb489
to
38c079f
Compare
38c079f
to
e6cfe8a
Compare
e6cfe8a
to
246a64a
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.
Doing the lord's work 🙌
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.
Oh wow that's a lot of type hints 🎉
This really makes me miss the Typescript type system though 😉
I only have one minor comment:
larq/constraints.py
Outdated
return tf.clip_by_value(x, -self.clip_value, self.clip_value) | ||
|
||
def get_config(self): | ||
def get_config(self) -> Dict: |
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.
General Python typehints question: Is using the builtin dict
equivalent to typings.Dict
in this case?
def get_config(self) -> Dict: | |
def get_config(self) -> dict: |
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.
Not 100% sure about the difference, but now I look into it apparently it's better to use typing.Mapping
for such things, so I will edit.
No description provided.