Brett Cannon wrote:
> So we don't want to strengthen the definition at
> all; best we are comfortable with is put up a warning that you don't want
> to do stuff with sys.modules unless you know what you're doing.
OK, thanks for the clarification. Having read through the source of importlib
one
On Sat, Apr 9, 2022 at 1:53 PM dfremont--- via Python-Dev <
python-dev@python.org> wrote:
> Thanks, Brett. I understand why the behavior happens, I just don't
> understand the decision to implement imports this way. Since there's no
> warning in the documentation that removing items from
On Sun, 10 Apr 2022, 8:44 am Eric V. Smith, wrote:
> On 4/9/2022 4:28 PM, Terry Reedy wrote:
> > On 4/9/2022 5:09 AM, Arfrever Frehtes Taifersar Arahesis wrote:
> >>
> >> Not only deletion, but also random assignments:
> >
> > Ok. Change "Manual deletion of entries from sys.modules" to "Direct
On 4/9/2022 4:28 PM, Terry Reedy wrote:
On 4/9/2022 5:09 AM, Arfrever Frehtes Taifersar Arahesis wrote:
Not only deletion, but also random assignments:
Ok. Change "Manual deletion of entries from sys.modules" to "Direct
manipulation of sys.modules"
I'm not sure it's worth the hassle to
Thanks, Brett. I understand why the behavior happens, I just don't understand
the decision to implement imports this way. Since there's no warning in the
documentation that removing items from sys.modules can break the fact that
"import X.Y" defines "X.Y" (note that the "behind the curtain"
On 4/9/2022 5:09 AM, Arfrever Frehtes Taifersar Arahesis wrote:
2022-04-09 04:24 UTC, Terry Reedy は書いた:
Perhaps something intentionally vague like
"Manual deletion of entries from sys.modules may invalidate statements
above, even after re-imports."
or
"Manual deletion of entries from
> Not only deletion, but also random assignments:
>
> >>> import sys
> >>> import collections.abc
> >>> sys.modules['collections'] = 1
> >>> import collections.abc
> >>> collections.abc
> Traceback (most recent call last):
> File "", line 1, in
> AttributeError: 'int' object has no attribute
2022-04-09 04:24 UTC, Terry Reedy は書いた:
> Perhaps something intentionally vague like
>
> "Manual deletion of entries from sys.modules may invalidate statements
> above, even after re-imports."
>
> or
>
> "Manual deletion of entries from sys.modules may result in surprising
> behavior, even after
On 4/8/2022 7:56 PM, Brett Cannon wrote:
On Fri, Apr 8, 2022 at 4:38 PM dfremont--- via Python-Dev
mailto:python-dev@python.org>> wrote:
If you import A.B, then remove A from sys.modules and import A.B
again, the newly-loaded version of A will not contain an attribute
referring
On Fri, Apr 8, 2022 at 4:38 PM dfremont--- via Python-Dev <
python-dev@python.org> wrote:
> Hello,
>
> I came across what seems like either a bug in the import system or a gap
> in its documentation, so I'd like to run it by folks here to see if I
> should submit a bug report. If there's
10 matches
Mail list logo