Skip to content
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

Add type annotations and distribute them (PEP561) #73

Merged
merged 2 commits into from Jun 17, 2020

Conversation

hukkin
Copy link
Contributor

@hukkin hukkin commented Jun 16, 2020

Closes #72

  • Add type annotations
  • Distribute type data
  • Check types using mypy

Copy link
Contributor

@matejcik matejcik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor nitpicks, otherwise looks good

.travis.yml Outdated Show resolved Hide resolved
return [
f.split(".")[0]
for f in os.listdir(cls._get_directory())
if f.endswith(".txt")
]

@staticmethod
def normalize_string(txt):
def normalize_string(txt: Union[bytes, str]) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnyStr instead of this union?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is something for another PR, and a breaking change, but we could also consider removing bytes support from normalize_string altogether. Internally we never pass bytes to this method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but it doesn't seem worth it. Variability here costs us next to nothing.

mnemonic/py.typed Outdated Show resolved Hide resolved
@hukkin
Copy link
Contributor Author

hukkin commented Jun 16, 2020

👍 Made the changes

@matejcik matejcik merged commit 717a35c into trezor:master Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Distribute type annotations
3 participants