News for hackers. Stuff that matters.
Re:No-op statements syntactically valid only since Python X.Y by plq on Monday June 06, 2022 @07:03AM (#31638968)
You can split your big module into modules inside a sub-package and import stuff in the __init__.py file from the submodules to present a nice interface to the library user.

eg instead of:

    namespace.py
        class C1:
        class C2:
do

    namespace/__init__.py
        from .c1 import C1
        from .c2 import C2

    namespace/c1.py
        class C1:

    namespace/c2.py
        class C2:
Re:No-op statements syntactically valid only since Python X.Y by eesmith on Monday June 06, 2022 @03:03PM (#31644438)
What I don't like about this approach is how I'm supposed to refer to something by namespace.C1 but its repr is namespace.c1.C1.

I would prefer if the repr reported its primary public API name, not its internal implementation location.

Re:No-op statements syntactically valid only since Python X.Y by eloisius on Monday June 06, 2022 @07:10AM (#31639013)
That’s what I described as the facade module approach.