Bruno Dupuis added the comment: We definitely need to put the code that loads constants with LOAD_CONST out of the optimization code. It's not optim, it's a language feature: None *is* a 'singleton' constant.
I'm trying to figure out how to change compile.c to achieve this, as it's my first dive into the compiler code, it's not that easy. Another approch is to strip unreachable nodes in AST, but a) it's quite complex, as Terry said b) it solves only this particular bug, not the general assertion "None, True and False are reserved words bound to constants. It can not ever be loaded with LOAD_NAME or LOAD_GLOBAL" ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16619> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com