Skip to content

[TD-012] Missing __all__ in library modules #11

@LFigg

Description

@LFigg

Description

Python library modules don't define __all__, so from lib.utils import * would import internal/private functions.

Location

  • Files: lib/config.py, lib/models.py, lib/utils.py

Impact

  • Unintentional exposure of private APIs
  • Potential for unintended imports
  • Less clear public API surface

Suggested Fix

Add __all__ to each module defining the public API:

# lib/utils.py
__all__ = [
    'setup_logging',
    'parallel_collect',
    'retry_with_backoff',
    'redact_sensitive_data',
    # ... other public functions
]

Priority

Low

Source

TECH_DEBT.md - TD-012

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions