Add support for absolute/relative imports and if/else expressions:

- regenerate ast.py
 - add future flags for absolute-import and with-statement so they
   (hopefully) properly get set in code-object flags
 - try out if/else expressions in actual code for the hell of it.

Seems to generate the same kind of bytecode as the normal compiler.
This commit is contained in:
Thomas Wouters 2006-03-03 18:16:20 +00:00
parent 7e2ac2533e
commit fa0cf4f3ae
5 changed files with 82 additions and 19 deletions

View file

@ -771,7 +771,7 @@ class StackDepthTracker:
'COMPARE_OP': -1,
'STORE_FAST': -1,
'IMPORT_STAR': -1,
'IMPORT_NAME': 0,
'IMPORT_NAME': -1,
'IMPORT_FROM': 1,
'LOAD_ATTR': 0, # unlike other loads
# close enough...