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
Conversation
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.
some minor nitpicks, otherwise looks good
mnemonic/mnemonic.py
Outdated
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: |
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.
AnyStr
instead of this union?
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 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.
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.
True, but it doesn't seem worth it. Variability here costs us next to nothing.
👍 Made the changes |
Closes #72