summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-03-30py: Don't wrap necessary function calls in assert.Damien George
2014-03-30Merge pull request #399 from pfalcon/gen-defargsDamien George
objgenerator: Handle default args to generator functions.
2014-03-30py: Fix "TypeError: 'iterator' object is not iterable", doh.Paul Sokolovsky
2014-03-30py: Implement support for generalized generator protocol.Paul Sokolovsky
Iterators and ducktype objects can now be arguments of yield from.
2014-03-30objzip: Use mp_identity().Paul Sokolovsky
2014-03-30py: Implement positional and keyword args via * and **.Damien George
Extends previous implementation with * for function calls to * and ** for both function and method calls.
2014-03-30Merge pull request #396 from pfalcon/call-starDamien George
vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).
2014-03-30objgenerator: Handle default args to generator functions.Paul Sokolovsky
Addresses #397.
2014-03-30vm: Implement DELETE_FAST_N bytecode.Paul Sokolovsky
2014-03-30vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).Paul Sokolovsky
2014-03-30showbc: Dump all CALL_FUNCTION_* and CALL_METHOD_* opcodes.Paul Sokolovsky
2014-03-30Merge map.h into obj.h.Damien George
Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
2014-03-30Rename rt_* to mp_*.Damien George
Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
2014-03-30objexcept: Fix another place missing proper args tuple initialization.Paul Sokolovsky
2014-03-30objgenerator.throw: Instantiate if exception type passed, just as "raise".Paul Sokolovsky
Caught by CPython test_pep380.py.
2014-03-30objgenerator.throw(): Throwing GeneratorExit is equivalent to .close().Paul Sokolovsky
According to PEP380 and caught by CPython test_pep380.py .
2014-03-30objgenerator: Store proper code_info pointer.Paul Sokolovsky
2014-03-30objgenerator: mp_obj_gen_resume() suitable only for generators.Paul Sokolovsky
2014-03-30compile: Print error messages on unimplemented relative imports.Paul Sokolovsky
2014-03-30mp_obj_print_exception(): Assert that traceback has sane number of entries.Paul Sokolovsky
2014-03-30py: Rename mp_exc_stack to mp_exc_stack_t.Damien George
2014-03-30py: Fix reraise logic.Damien George
2014-03-30vm: Save current active exception on opening new try block.Paul Sokolovsky
Required to reraise correct exceptions in except block, regardless if more try blocks with active exceptions happen in the same except block. P.S. This "automagic reraise" appears to be quite wasteful feature of Python - we need to save pending exception just in case it *might* be reraised. Instead, programmer could explcitly capture exception to a variable using "except ... as var", and reraise that. So, consider disabling argless raise support as an optimization.
2014-03-30vm: WITH_CLEANUP: use POP_EXC_BLOCK().Paul Sokolovsky
2014-03-29vm: Establish macros PUSH_EXC_BLOCK & POP_EXC_BLOCK to deal with exc stack.Paul Sokolovsky
E.g. to handle currently_in_except_block restoring properly.
2014-03-29py: Reraising exception possible only in except block.Paul Sokolovsky
2014-03-29Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-03-29py: Support mpz -op- float, mpz -op- complex, and complex -op- mpz.Damien George
2014-03-29vm: Elaborate comments for WITH_CLEANUP, other cosmetic fixes.Paul Sokolovsky
2014-03-29py: Make MP_BC_SETUP_WITH use the bytecode stack for load_method.Damien George
The compiler allocates 7 entries on the stack for a with statement (following CPython, but probably can be reduced). This is enough for the method load and call in SETUP_WITH.
2014-03-29Merge pull request #389 from pfalcon/with-statementDamien George
With statement implementation
2014-03-29py: Fix regress with GeneratorExit object becoming truly const.Damien George
2014-03-29py: Rename old const type objects to mp_type_* for consistency.Damien George
2014-03-29py: Change mp_const_* objects to macros.Damien George
Addresses issue #388.
2014-03-29Merge pull request #383 from pfalcon/yield-fromDamien George
Implement "yield from"
2014-03-29py: Fix typo printing complex numbers that are purely imaginary.Damien George
2014-03-29py: Free unique_code slot for outer module.Damien George
Partly (very partly!) addresses issue #386. Most importantly, at the REPL command line, each invocation does not now lead to increased memory usage (unless you define a function/lambda).
2014-03-29vm: Implement "with" statement (SETUP_WITH and WITH_CLEANUP bytecodes).Paul Sokolovsky
2014-03-29vm: Make sure that exception triple is <type, instance, traceback>.Paul Sokolovsky
This reduntant triple is one of the ugliest parts of Python, which they chickened out to fix in Python3. We really should consider passing just as single exception instance (without breaking Python-level APIs of course), but until we do, let's follow CPython layout.
2014-03-29vm: Factor out exception block setup to a macro.Paul Sokolovsky
Will be reused in WITH bytecodes.
2014-03-29Merge pull request #382 from pfalcon/genexit-instDamien George
objgenerator: close(): Throw instance of GeneratorExit (not type).
2014-03-28py: Fix bugs with debugging output.Damien George
show_bc now decodes the prelude correctly. Moved WRITE_FILE stuff from runtime.c to emitglue.c. Addresses issue #385.
2014-03-28py: yield from: Elaborate GeneratorExit (gen.close()) handling.Paul Sokolovsky
Handling of GeneratorExit is really peculiar - it subverts normal exception propagation rules.
2014-03-28py: Core "yield from" implementation.Paul Sokolovsky
2014-03-28objgenerator: close(): Throw instance of GeneratorExit (not type).Paul Sokolovsky
To comply with Python semantics and allow use of mp_obj_is_subclass_fast() for exception matching.
2014-03-28showbc: Add few bytecodes related to "with".Paul Sokolovsky
2014-03-27py: Thin out predefined exceptions.Damien George
Only exceptions that are actually used are left prefedined. Hierarchy is still there, and removed exceptions are just commented out.
2014-03-27py: Fix typo printing complex numbers.Damien George
2014-03-27py: Rename emit_pre so they have globally unique names.Damien George
2014-03-27py: Factor out code from runtime.c to emitglue.c.Damien George