summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.Damien George2014-04-02
|
* py: Fix up so that it can compile without float.Damien George2014-04-02
|
* py: Enable a jump optimisation in the compiler.Damien George2014-04-02
|
* py: Move to Python 3.4.0 compatibility.Damien George2014-04-02
| | | | | | | | | | | | | Very little has changed. In Python 3.4 they removed the opcode STORE_LOCALS, but in Micro Python we only ever used this for CPython compatibility, so it was a trivial thing to remove. It also allowed to clean up some dead code (eg the 0xdeadbeef in class construction), and now class builders use 1 less stack word. Python 3.4.0 introduced the LOAD_CLASSDEREF opcode, which I have not yet understood. Still, all tests (apart from bytecode test) still pass. Bytecode tests needs some more attention, but they are not that important anymore.
* py: Factor out static/class method unwrapping code; add tests.Damien George2014-04-02
|
* py: Implement floating point power binop.Damien George2014-04-02
|
* py: Allow multiple of str/list/tuple on left by an integer.Damien George2014-04-02
|
* py: Add support for sep and end keywords in print.Damien George2014-04-02
|
* py: Fix math.{ceil,floor,trunc} to return int.Damien George2014-04-01
|
* py: Make pfenv.c conform to code conventions.Damien George2014-04-01
|
* Reduce stack usage of pfenv_print_strnDave Hylands2014-04-01
|
* Fix INT_BUF_SIZE to work with 32-bit and 64-bitDave Hylands2014-04-01
|
* py: Remove implicit conversion from int to float.Damien George2014-04-01
|
* Enhance str.format supportDave Hylands2014-04-01
| | | | | | | | | | | This adds support for almost everything (the comma isn't currently supported). The "unspecified" type with floats also doesn't behave exactly like python. Tested under unix with float and double Spot tested on stmhal
* py: Implement __getattr__.Damien George2014-03-31
| | | | | | | | It's not completely satisfactory, because a failed call to __getattr__ should not raise an exception. __setattr__ could be implemented, but it would slow down all stores to a user created object. Need to implement some caching system.
* objstr: Very basic implementation of % string formatting operator.Paul Sokolovsky2014-03-31
|
* py: Wrap .__class__ handling in MICROPY_CPYTHON_COMPAT.Paul Sokolovsky2014-03-31
| | | | | Because it's superfluos in the presence of type(), a remenant from Python's "old classes".
* objtype: Wrap .__name__ handling in MICROPY_CPYTHON_COMPAT.Paul Sokolovsky2014-03-31
| | | | | | | | Because it's runtime reflection feature, not required for many apps. Rant time: Python could really use better str() vs repr() distinction, for example, repr(type) could be "<class 'foo'>" (as it is now), and str(type) just "foo". But alas, getting straight name requires adhoc attribute.
* py: Fix bug in optimised for .. range.Damien George2014-03-31
| | | | | | Don't store final, failing value to the loop variable. This fix also makes for .. range a bit more efficient, as it uses less store/load pairs for the loop variable.
* py: Fix vstr_init for case that alloc = 0.Damien George2014-03-31
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-31
|\
| * objtype: Add virtual __name__ attribute.Paul Sokolovsky2014-03-31
| | | | | | | | | | It's virtual because it's not shown in dir(...). (That's also how CPython has it).
| * mp_resume: Dare to pass send_value of NULL.Paul Sokolovsky2014-03-31
| | | | | | | | | | | | | | There was thinkos that either send_value or throw_value is specified, but there were cases with both. Note that send_value is pushed onto generator's stack - but that's probably only good, because if we throw exception into gen, it should not ever use send_value, and that will be just extra "assert".
| * mp_resume: Elaborate handling of .throw() for objects which lack it.Paul Sokolovsky2014-03-31
| | | | | | | | | | | | In this case, the exception is just re-thrown - the ideas is that object doesn't handle this exception specially, so it will propagated per Python semantics.
| * objgenerator.throw(GeneratorExit) is not equivalent to .close().Paul Sokolovsky2014-03-31
| | | | | | | | | | | | | | | | | | .throw() propagates any exceptions, and .close() swallows them. Yielding in reponse to .throw(GeneratorExit) is still fatal, and we need to handle it for .throw() case separately (previously it was handled only for .close() case). Obscure corner cases due to test_pep380.py.
| * objgenerator: Another obscure case of propagating MP_OBJ_NULL optimization.Paul Sokolovsky2014-03-31
| |
* | py: Remove old "run time" functions that were 1 liners.Damien George2014-03-31
| |
* | py: Disable dump_args function call entirely when not debugging.Damien George2014-03-31
| | | | | | | | | | Yes, I know, a good compiler will optimise this away, but I feel this is neater.
* | py: Towards default keyword arguments.Damien George2014-03-31
|/ | | | These are default arguments after a bare *.
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-31
|\
| * py: Properly implement divide-by-zero handling.Paul Sokolovsky2014-03-31
| | | | | | | | | | "1/0" is sacred idiom, the shortest way to break program execution (sys.exit() is too long).
| * objfloat: Quick&dirty implementation of float floor division.Paul Sokolovsky2014-03-31
| | | | | | | | TODO: Likely doesn't match Python semantics for negative numbers.
| * compile: Don't try to constant-fold division by zero.Paul Sokolovsky2014-03-31
| | | | | | | | | | The way it is, just crashes app. And optimizing to "raise ZeroDivisionError" is probably too much.
| * objfloat: Make sure that floats always have dot (for C "double" type case).Paul Sokolovsky2014-03-31
| | | | | | | | | | This matches CPython behavior and hopefully can be treated as general Python semantics.
| * objfloat: Missing default: caused incorrect results for unimplemented ops.Paul Sokolovsky2014-03-31
| |
| * objexcept: No more magic messages in exceptions, only exception arguments.Paul Sokolovsky2014-03-31
| | | | | | | | | | | | | | One of the reason for separate "message" (besides still unfulfilled desire to optimize memory usage) was apparent special handling of exception with messages by CPython. Well, the message is still just an exception argument, it just printed specially. Implement that with PRINT_EXC printing format.
* | py: Add LOAD_NULL bytecode and use it to simplify function calls.Damien George2014-03-31
| | | | | | | | | | | | | | Adding this bytecode allows to remove 4 others related to function/method calls with * and ** support. Will also help with bytecodes that make functions/closures with default positional and keyword args.
* | py: Rename and reorder parameters in emit_make_function/closure.Damien George2014-03-31
|/ | | | In preparation for implementing default keyword arguments.
* py: Add equality test for None object.Damien George2014-03-30
|
* py: Add explicit conversion from float to int via int().Damien George2014-03-30
|
* py: Fix bug in compiler for empty class bases.Damien George2014-03-30
| | | | Eg class A(): pass would fail an assertion.
* py: Don't wrap necessary function calls in assert.Damien George2014-03-30
|
* Merge pull request #399 from pfalcon/gen-defargsDamien George2014-03-30
|\ | | | | objgenerator: Handle default args to generator functions.
| * objgenerator: Handle default args to generator functions.Paul Sokolovsky2014-03-30
| | | | | | | | Addresses #397.
* | py: Fix "TypeError: 'iterator' object is not iterable", doh.Paul Sokolovsky2014-03-30
| |
* | py: Implement support for generalized generator protocol.Paul Sokolovsky2014-03-30
| | | | | | | | Iterators and ducktype objects can now be arguments of yield from.
* | objzip: Use mp_identity().Paul Sokolovsky2014-03-30
| |
* | py: Implement positional and keyword args via * and **.Damien George2014-03-30
| | | | | | | | | | Extends previous implementation with * for function calls to * and ** for both function and method calls.
* | Merge pull request #396 from pfalcon/call-starDamien George2014-03-30
|\ \ | |/ |/| vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).
| * vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).Paul Sokolovsky2014-03-30
| |