FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.13k stars 362 forks source link

need cleaner module/class import in __init__.py(s) files #36

Closed oroulet closed 5 years ago

oroulet commented 5 years ago

Scrutinizer complains a lot about the code in the init,py files. @cbergmiller you wrote/changed them. I am not sure how they should be. Someone should find out what the best practices are... https://scrutinizer-ci.com/g/FreeOpcUa/opcua-asyncio/

oroulet commented 5 years ago

My understanding is that it is better to have as little code as possible in these files. as the libray grows (And it is already quite big) importing these modules cost Only the stuff used absolutely everywhere llike Node should be imported there https://stackoverflow.com/questions/35727134/module-imports-and-init-py-in-python

also I have ever really used the all stuff. I simply name internal stuff in modules starting with _

cbergmiller commented 5 years ago

I can change the import strategy and remove the __all__ magic. Should improve the Scrutinizer score.

oroulet commented 5 years ago

The goal is not to improve the score, I am just thinking that it probably highlight an issue ;-)