Message186767
Here's a simple patch to optimize away constant boolean conjunctions/disjunctions. for example:
def foo():
if 1 and 0:
print("hi")
now disassembles into:
7 0 LOAD_CONST 0 (None)
3 RETURN_VALUE
while I realize more general techniques for achieving this have been proposed (ie http://bugs.python.org/issue1346238), this is a very simple, self-contained patch. |
|
Date |
User |
Action |
Args |
2013-04-13 17:17:57 | Stephen.Tu | set | recipients:
+ Stephen.Tu |
2013-04-13 17:17:57 | Stephen.Tu | set | messageid: <1365873477.58.0.16753210186.issue17718@psf.upfronthosting.co.za> |
2013-04-13 17:17:57 | Stephen.Tu | link | issue17718 messages |
2013-04-13 17:17:57 | Stephen.Tu | create | |
|