Message358767
import builtins
builtins.__dict__['__debug__'] = 'Surprise!'
builtins.__dict__['None'] = 'Surprise!'
print(__debug__)
print(None)
$ ./python ../t.py
True
None
I guess this is related to Python/ast_opt.c transformation
case Name_kind:
if (_PyUnicode_EqualToASCIIString(node_->v.Name.id, "__debug__")) {
return make_const(node_, PyBool_FromLong(!optimize_), ctx_);
}
break; |
|
Date |
User |
Action |
Args |
2019-12-21 08:34:18 | BTaskaya | set | recipients:
+ BTaskaya, steven.daprano, serhiy.storchaka, matrixise, bup, xtreak |
2019-12-21 08:34:17 | BTaskaya | set | messageid: <1576917257.87.0.271796536748.issue36000@roundup.psfhosted.org> |
2019-12-21 08:34:17 | BTaskaya | link | issue36000 messages |
2019-12-21 08:34:17 | BTaskaya | create | |
|