Oct. 20, 2019
6:22 a.m.
Steven D'Aprano wrote:
I've read the entire thread, and I don't understand what builtins has to do with your problem.
Just that, as a workaround, I can have the classdict object raise KeyError for anything that's a member of builtins so that the builtins are used instead of being masked.
But regardless, you shouldn't touch __builtins__, it is a private implementation detail of CPython. The right way is: import builtins # Python 3 import __builtin__ as builtins # Python 2
and then use builtins.
Thanks for setting me straight on this. Much appreciated.