SmokeDetector icon indicating copy to clipboard operation
SmokeDetector copied to clipboard

Should we use type hints?

Open CoconutMacaroon opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Python has support for type hints. They have advantages (IDEs and other tools can help users avoid making type-related errors by checking, for one). I'm not aware of any major disadvantages currently (SD supports Python 3.6 and they were added in 3.5, so compatibility isn't a huge concern I think). Overall, I personally tend to like them as having my IDE verify I don't mess up types is handy.

Describe the solution you'd like

Use type hints on new code added to SD (and maybe some existing code, although I don't think that is really a priority).

Describe alternatives you've considered

N/A

Additional context

I asked if they should be used and Makyen said it would be reasonable to open an issue on GH to discuss it

CoconutMacaroon avatar Dec 27 '22 00:12 CoconutMacaroon

Personal opinion: yes.

However implementation code-base wise will be complex and may introduce some headaches for syntax, etc. While generally I agree with us using type hinting, this is really a wider scale change than you think it is.

teward avatar Dec 27 '22 01:12 teward