TeamPyOgg / PyOgg

Simple OGG Vorbis, Opus and FLAC bindings for Python
The Unlicense
63 stars 27 forks source link

Typing and MyPy #54

Closed mattgwwalker closed 3 years ago

mattgwwalker commented 3 years ago

@Zuzu-Typ I'm currently still fighting to work out what the issue is in Windows before committing #50.

As a debugging tool I've started adding type information (which can be processed by mypy, a static type checker). Adding the type information can improve the documentation and helps programmers know what they should be passing to a given function. Adding type information also apparently has negligible impact on performance.

Do you have any negative thoughts on adding the type information? If you don't have any issues then I'll keep adding it in as it's proving helpful. It may then form a part of pull request #50.

Cheers,

Matthew

Zuzu-Typ commented 3 years ago

@mattgwwalker I don't see any reason not to use type hints. Feel free to do so if it helps (:

Cheers
--Zuzu_Typ--

mattgwwalker commented 3 years ago

I've added type hinting into a fair amount of PyOgg (see pull request #58).

The PyOgg package and its tests are now passing mypy's checks.

Calls to mypy should be added into the Travis CI script to automate mypy checks. I'll leave this issue open as a reminder.

mattgwwalker commented 3 years ago

Mypy tests have now been added to the Travis CI script (see #59).

Discussion of mypy testing should be added to the documentation.

mattgwwalker commented 3 years ago

Mypy and type-hinting documentation has been added (see #60). Closing.