python pep8 class in init imported but not used

后端 未结 3 855
轻奢々
轻奢々 2021-02-02 05:42

I\'m doing PEP8 checks in python using the python flake8 library. I have an import statement in an __init__.py file in one of my sub-modules which looks like this:<

3条回答
  •  不思量自难忘°
    2021-02-02 05:49

    According to PEP 8, you should include MyClass in __all__, which will also fix the imported-but-not-used issue:

    To better support introspection, modules should explicitly declare the names in their public API using the __all__ attribute.

提交回复
热议问题