This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author larry
Recipients gvanrossum, kj, larry, pbryan
Date 2021-04-29.20:48:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619729287.93.0.13597528869.issue42904@roundup.psfhosted.org>
In-reply-to
Content
Thank you for your in-depth and thoughtful reply!

I think that APIs should behave in a predictable way.  So, for my use case, I tell the user that I'm passing "globals" and "locals" into eval()--and I think I'd have to have a *very* compelling reason to swap them.  Since I don't have the backwards-compatibility problem you do, I think I should keep it simple and predictable and not swap them.

In reference to your example, I think it's natural enough that the A defined inside B eclipses the module-level A.  That's what the user would *expect* to happen.  If the user really wants to reference the module-level A, they have lots of options:

  * rename one or the other A to something else
  * establish an alias at module scope, and use that
  * explicitly say globals()['A']

So I'm not worried about it.
History
Date User Action Args
2021-04-29 20:48:07larrysetrecipients: + larry, gvanrossum, pbryan, kj
2021-04-29 20:48:07larrysetmessageid: <1619729287.93.0.13597528869.issue42904@roundup.psfhosted.org>
2021-04-29 20:48:07larrylinkissue42904 messages
2021-04-29 20:48:07larrycreate