New submission from Barry A. Warsaw <ba...@python.org>:
TL;DR module.__spec__.parent is read-only but module.__package__ is r/w despite documentation that implies that these two attributes should be identical, and various issues that focus on migrating from direct module attributes to ModuleSpec attributes. bpo-33277 and bpo-21762 Maybe we should relax the restriction on module.__spec__.parent so that it's writeable just like module.__package__. See also: https://docs.python.org/3/reference/import.html?highlight=__loader__#package__ https://docs.python.org/3/library/types.html?highlight=__loader__#types.ModuleType.__package__ ---------- components: Interpreter Core messages: 404500 nosy: barry priority: normal severity: normal status: open title: module.__package__ and module.__spec__.parent have different semantics versions: Python 3.11 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45540> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com