New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

__debug__ is substituted by the constant value at the code generation stage 
(see issue27169). This prevents it from participating in constant folding at 
the AST level. The proposed patch moves this optimization to the AST level. 
This will lead to optimizing "if not __debug__" and will allow to add more 
optimizations at the AST level (like optimizing expressions "a if __debug__ 
else b" and "__debug__ and a").

----------
assignee: serhiy.storchaka
components: Interpreter Core
messages: 308643
nosy: inada.naoki, pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Optimize out __debug__ at the AST level
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32372>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to