Paul Sokolovsky
1b694c082e
Rename fun-kwargs.py -> fun-kwvarargs.py to free up slot for simple kw test.
11 years ago
Paul Sokolovsky
91ba7a54c5
builtinimport: Get the basic (and only basic) package imports work.
11 years ago
Damien George
e5d371b545
py: Pass keyword arguments to byte code.
11 years ago
Damien George
2e482cdb7b
py: Implement *vargs support.
Addresses issue #295 .
11 years ago
Damien George
c8f78bc280
py: VM never throws an exception, instead returns a status and value.
Addresses issue #290 , and hopefully sets up things to allow generators
throwing exceptions, etc.
11 years ago
Paul Sokolovsky
8ac72b9d00
Add testcase for failing namespace switch throwing exception from a module.
Issue #290 . This currently fails, to draw attention to the issue.
11 years ago
Paul Sokolovsky
e7299b5296
Add testcase for "from module import *".
11 years ago
Paul Sokolovsky
b2e8c52298
Add testcase for "from module import sym".
11 years ago
Paul Sokolovsky
2aa217b974
Implement full arg handling for exec().
11 years ago
Paul Sokolovsky
8d90a382cf
basics/enumerate.py: Don't turn enumerate test into heap test.
With range(10000), doesn't fit into 128K heap.
11 years ago
Paul Sokolovsky
ac0134d427
Factor out mp_seq_count_obj() and implement tuple.count().
11 years ago
Paul Sokolovsky
624eff6a8a
Implement tuple.index().
11 years ago
Paul Sokolovsky
2f0b026a44
Clean up handling of function return type annotation.
11 years ago
Paul Sokolovsky
f7c2410e65
Implement tuple multiplication.
11 years ago
Paul Sokolovsky
ee4aaf7cdd
Implement tuple addition.
11 years ago
Paul Sokolovsky
e827e98a6f
Implement tuple comparison.
11 years ago
Paul Sokolovsky
1e19b24ea0
io.File, socket types: Add fileno() method.
Implementation is duplicated, but tolerate this for now, because there's
no clear idea how to de-dup it.
11 years ago
Paul Sokolovsky
9fce77c993
Add more finally + break/continue testcases.
11 years ago
Paul Sokolovsky
3c95ba7e4e
Add additional testcase for finally/return.
11 years ago
Damien George
35e2a4e6bb
py: Add built-in super.
11 years ago
Paul Sokolovsky
00c0b8a989
Fix unstable case in builtin_id.py test.
11 years ago
Damien George
330cf6d04a
Change id to return signed integer.
11 years ago
Paul Sokolovsky
87e85b7dc7
Implement str/bytes rich comparisons.
11 years ago
xbe
0ebf8534ab
Implement and add tests for the id() builtin function.
11 years ago
Paul Sokolovsky
9ed5435061
Implement slicing for tuples.
11 years ago
Paul Sokolovsky
13cfabd1b2
Implement slicing for lists.
11 years ago
Paul Sokolovsky
513e6567b1
Add testcase for sequence unpacking.
11 years ago
Damien George
cbddb279bb
py: Implement break/continue from an exception with finally.
Still todo: break/continue from within the finally block itself.
11 years ago
Paul Sokolovsky
90750029df
Implement default function arguments (for Python functions).
TODO: Decide if we really need separate bytecode for creating functions
with default arguments - we would need same for closures, then there're
keywords arguments too. Having all combinations is a small exponential
explosion, likely we need just 2 cases - simplest (no defaults, no kw),
and full - defaults & kw.
11 years ago
Paul Sokolovsky
6472dea146
Add exception stack unwind support for RETURN_VALUE.
This properly implements return from try/finally block(s).
TODO: Consider if we need to do any value stack unwinding for RETURN_VALUE
case. Intuitively, this is "success" return, so value stack should be in
good shape, and unwinding shouldn't be required.
11 years ago
Paul Sokolovsky
c9887cbbe2
Add basic try-finally testcase.
It's mildly suprising these work without further changes to exception
handling code (the only change required was to handle SETUP_FINALLY).
11 years ago
Paul Sokolovsky
027594e1a7
Typo fixes in comments.
11 years ago
Paul Sokolovsky
c92a56dc93
Add testcase with exception handler spread across functions.
11 years ago
xbe
480c15afb5
Implement str.replace and add tests for it.
11 years ago
xbe
65365778fd
Add tests for str.strip
11 years ago
Paul Sokolovsky
382e8eeea2
vm: Add basic implementation of END_FINALLY opcode.
Allows to have nested try blocks with except filters.
TODO: Don't add END_FINALLY's exception re-raise points to traceback.
11 years ago
Damien George
09a0c64bce
py: Improve __bool__ and __len__ dispatch; add slots for them.
11 years ago
Paul Sokolovsky
c1d9bbc345
Implement __bool__ and __len__ via unary_op virtual method for all types.
__bool__() and __len__() are just the same as __neg__() or __invert__(),
and require efficient dispatching implementation (not requiring search/lookup).
type->unary_op() is just the right choice for this short of adding
standalone virtual method(s) to already big mp_obj_type_t structure.
11 years ago
Damien George
4a74d31e70
run-tests can handle segfault.
11 years ago
Damien George
b40892d266
Rename array test to array1 so it doesn't clash with array module.
On my machine, 'import array' in CPython tries to load the array test.
11 years ago
Markus Siemens
19ccc6bdc7
Added Windows port (see #233 )
11 years ago
Paul Sokolovsky
1801421f6d
bytearray: Print objects properly.
11 years ago
Paul Sokolovsky
8e991e0680
Add basic array.array test.
11 years ago
Damien George
4e8dc8c41b
py: Add unary op not for NoneType, bool, tuple, list, dict; fix for int.
11 years ago
Paul Sokolovsky
9b00dad7bb
long int: Implement more operations.
11 years ago
Paul Sokolovsky
14d28be344
gen.send(): Throw StopIteration. Also, explicitly shutdown finished gen.
Otherwise, some generator statements still may be spuriously executed on
subsequent calls to next()/send().
11 years ago
Paul Sokolovsky
bf38e2a03a
Implement send() method for generators.
11 years ago
Damien George
7c9c667633
py: Implement iterator support for object that has __getitem__.
Addresses Issue #203 .
11 years ago
Paul Sokolovsky
91fb1c9b13
Add basic implementation of bytes type, piggybacking on str.
This reuses as much str implementation as possible, from this we
can make them more separate as needed.
11 years ago
Paul Sokolovsky
c3e72a8cc8
mp_obj_is_callable(): Only object types can be callable.
Fixes segfault on callable("string").
11 years ago