| Commit message (Collapse) | Author | Age |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Because it's superfluos in the presence of type(), a remenant from Python's
"old classes".
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
It's virtual because it's not shown in dir(...). (That's also how CPython
has it).
|
| |
| |
| |
| |
| |
| |
| | |
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".
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
.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.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Yes, I know, a good compiler will optimise this away, but I feel this is
neater.
|
|/
|
|
| |
These are default arguments after a bare *.
|
|\ |
|
| |
| |
| |
| |
| | |
"1/0" is sacred idiom, the shortest way to break program execution
(sys.exit() is too long).
|
| |
| |
| |
| | |
TODO: Likely doesn't match Python semantics for negative numbers.
|
| |
| |
| |
| |
| | |
The way it is, just crashes app. And optimizing to
"raise ZeroDivisionError" is probably too much.
|
| |
| |
| |
| |
| | |
This matches CPython behavior and hopefully can be treated as general
Python semantics.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
In preparation for implementing default keyword arguments.
|
| |
|
| |
|
|
|
|
| |
Eg class A(): pass would fail an assertion.
|
| |
|
|\
| |
| | |
objgenerator: Handle default args to generator functions.
|
| |
| |
| |
| | |
Addresses #397.
|
| | |
|
| |
| |
| |
| | |
Iterators and ducktype objects can now be arguments of yield from.
|
| | |
|
| |
| |
| |
| |
| | |
Extends previous implementation with * for function calls to * and **
for both function and method calls.
|
|\ \
| |/
|/| |
vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).
|
| | |
|