rmqrcode-python
rmqrcode-python copied to clipboard
Add type hints and Refactoring
resolve #38 Commits are separate for adding type hints and refactoring.
Type hints have been added to the following places:
- Method arguments
- Return values of abstract methods
- Variables for which can not type inference, such as
[]
For dicts, the element type has been made explicit with TypedDict.
I noticed that commit 69a040e contains changes which is not of type hint.
It was added to prevent the variable type from becoming Unbound, but it affects when adding encoder types.
https://github.com/tkamiya22/rmqrcode-python/blob/69a040eb3e70adf733e8656f3784d9f574b94765/src/rmqrcode/segments.py#L166-L167
https://github.com/tkamiya22/rmqrcode-python/blob/69a040eb3e70adf733e8656f3784d9f574b94765/src/rmqrcode/segments.py#L188-L189