You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some constructs such as unpythonic.env.env and unpythonic.llist.llist have the same name as the submodule they live in. This hides the submodule from the dict of the top-level namespace of the unpythonic module. This behavior should be considered a bug.
To improve discoverability (e.g. groups of functionality; submodule top-level docstrings), the offending modules should be renamed to avoid becoming shadowed.
It's better to rename the modules than the symbols, since the symbols are certainly used by client code, but the submodule names necessarily aren't. It's not wrong to import directly from a submodule of unpythonic, if that feels more readable at the use site, but it's not mandatory, either, since the top-level __init__ imports all public symbols into the top-level unpythonic namespace. (This behavior is part of the public API, and is not going away.)
This is a breaking change, so we'll wait until the next major version before we do it.
CAUTION: Renaming the modules will break unpickling for instances that were pickled using the old version. [1] says that pickle can save and restore class instances transparently, however the class definition must be importable and live in the same module as when the object was stored. (emphasis mine)
The text was updated successfully, but these errors were encountered:
This is also an issue because of The submodules are added to the package namespace trap. So if anything, anywhere, imports one of the submodules, the name in the top-level unpythonic namespace will reset to point to the submodule.
Some constructs such as
unpythonic.env.env
andunpythonic.llist.llist
have the same name as the submodule they live in. This hides the submodule from the dict of the top-level namespace of theunpythonic
module. This behavior should be considered a bug.To improve discoverability (e.g. groups of functionality; submodule top-level docstrings), the offending modules should be renamed to avoid becoming shadowed.
It's better to rename the modules than the symbols, since the symbols are certainly used by client code, but the submodule names necessarily aren't. It's not wrong to import directly from a submodule of
unpythonic
, if that feels more readable at the use site, but it's not mandatory, either, since the top-level__init__
imports all public symbols into the top-levelunpythonic
namespace. (This behavior is part of the public API, and is not going away.)This is a breaking change, so we'll wait until the next major version before we do it.
CAUTION: Renaming the modules will break unpickling for instances that were pickled using the old version. [1] says that
pickle
can save and restore class instances transparently, however the class definition must be importable and live in the same module as when the object was stored. (emphasis mine)The text was updated successfully, but these errors were encountered: