m-lundberg / simple-pid

A simple and easy to use PID controller in Python
MIT License
792 stars 216 forks source link

mypy error when using `from simple_pid import PID` #48

Closed rnestler closed 2 years ago

rnestler commented 2 years ago

When I use from simple_pid import PID and check the code with mypy --strict I get the following error:

$ mypy --strict test.py
test.py:1: error: Module "simple_pid" does not explicitly export attribute "PID"; implicit reexport disabled

I guess this is an issue with the from .PID import PID in __init__.py? If I change it to from .PID import PID as PID it works.

Also I think it is strange that the import in __init__.py shadows the PID module in simple_pid.

Maybe it would be better to rename the module to pid?