Message392351
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. |
|
Date |
User |
Action |
Args |
2021-04-29 20:48:07 | larry | set | recipients:
+ larry, gvanrossum, pbryan, kj |
2021-04-29 20:48:07 | larry | set | messageid: <1619729287.93.0.13597528869.issue42904@roundup.psfhosted.org> |
2021-04-29 20:48:07 | larry | link | issue42904 messages |
2021-04-29 20:48:07 | larry | create | |
|