rmqrcode-python icon indicating copy to clipboard operation
rmqrcode-python copied to clipboard

Add type hints and Refactoring

Open tkamiya22 opened this issue 1 year ago • 1 comments

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.

tkamiya22 avatar Jul 21 '24 00:07 tkamiya22

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

tkamiya22 avatar Jul 21 '24 07:07 tkamiya22