ofek / bit

Bitcoin made easy.
https://ofek.dev/bit/
MIT License
1.25k stars 216 forks source link

Add Type Hints to Bech32 Functions #191

Open dollarparity opened 1 month ago

dollarparity commented 1 month ago

This pull request adds type hints to various Bech32 encoding/decoding functions in the provided codebase. These changes aim to improve code readability and make it easier for developers to understand the parameter types and return types of each function.

Adding type hints ensures that potential type errors can be caught early by tools such as mypy, and it also makes the code easier to maintain and review for developers in the future.

Type hints have been added to the following functions:

Changes:

Motivation and Context: Adding type hints improves the developer experience by providing clearer signatures for each function. It removes ambiguity about what types the functions expect and return, helping anyone new to the codebase to understand it faster. These hints also assist static analysis tools like mypy to catch potential bugs or type issues.