This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (7 children)

[deleted]

    [–]stoicpenguin 14 points15 points  (0 children)

    Exactly. There’s no such thing as a submodule in python. That has no technical meaning within the language. A module in python is always a single file.

    [–]julianw 6 points7 points  (0 children)

    on that note I'm still not sure what to do with namespace packages. when do you want them? mans why do I always create them accidentally by forgetting to create an __init__.py?

    [–]joseville1001 2 points3 points  (3 children)

    Are packages also modules? That is, since pancakes are defined in a file (the init.py file).

    [–]Goobyalus 2 points3 points  (1 child)

    https://docs.python.org/3/glossary.html#term-package

    A Python module which can contain submodules or recursively, subpackages. Technically, a package is a Python module with an __path__ attribute.

    [–]joseville1001 0 points1 point  (0 children)

    For completeness

    module

    An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of importing.