PyDocs

Nav

Python Runtime Services

module.__package__

builtins

attributeDeprecated 3.13
Deprecated since 3.13, removed in 3.15. __package__ will cease to be set or taken into consideration by the import system or standard library.
The package a module belongs to.
Changed in 3.4, 3.6, 3.10, 3.12
  • 3.4: This attribute now defaults to None for modules created dynamically using the types.ModuleType constructor. Previously the attribute was optional.
  • 3.6: The value of __package__ is expected to be the same as __spec__.parent. __package__ is now only used as a fallback during import resolution if __spec__.parent is not defined.
  • 3.10: ImportWarning is raised if an import resolution falls back to __package__ instead of __spec__.parent.
  • 3.12: Raise DeprecationWarning instead of ImportWarning when falling back to __package__ during import resolution.
0 Examples
No examples for builtins/module.__package__.
See Also
No see-alsos for builtins/module.__package__
0 Notes
No notes for module.__package__