opencc-python icon indicating copy to clipboard operation
opencc-python copied to clipboard

The OpenCC module currently lacks an explicit `__all__` definition in `__init__.py`.

Open rintrint opened this issue 8 months ago • 0 comments

This can lead to ambiguity in what is intended to be exposed when using from opencc import *.

Adding __all__ = ["OpenCC"] will:

  • Clearly define OpenCC as part of the public API.
  • Avoid potential issues with unintended imports.
  • Improve maintainability and clarify module structure.

This follows Python best practices for explicitly defining module exports.

##########################################################
# Author: Yichen Huang (Eugene)
# GitHub: https://github.com/yichen0831/opencc-python
# January, 2016
##########################################################

from .opencc import OpenCC

+ __all__ = ["OpenCC"]

rintrint avatar May 24 '25 07:05 rintrint