Rachel Dowdall
721c55dced
Added exception hierarchy except for OSError and UnicodeError (requires arguments). Comment out the errors that aren't needed if memory becomes an issue.
11 years ago
Rachel Dowdall
249b9c761d
Fixed broken math functions that return bool and added some more.
11 years ago
Paul Sokolovsky
1ecea7c753
py: Make 'bytes' be a proper type, support standard constructor args.
11 years ago
Paul Sokolovsky
42901554db
objint_longlong: Add regression test for improper inplace op implementation.
11 years ago
xbe
4504ea8007
Implement str.rpartition and add tests for it.
11 years ago
xbe
613a8e3edf
Implement str.partition and add tests for it.
11 years ago
Damien George
1609f85582
Rename test so that it doesn't clash with Python math module.
11 years ago
Rachel Dowdall
5a14a1d690
Added various simple functions to math module.
11 years ago
Damien George
2d7ff07175
py: Add mpz modulo operation.
11 years ago
Paul Sokolovsky
51bbf6a006
Implement support for __str__ and __repr__ special methods in classes.
11 years ago
Damien George
536dde254b
py: In string.count, handle case of zero-length needle.
11 years ago
xbe
c5d70ba48b
Fix issues in str.count implementation.
See pull request #343 .
11 years ago
xbe
9e1e8cd642
Implement str.count and add tests for it.
Also modify mp_get_index to accept:
1. Indices that are or evaluate to a boolean.
2. Slice indices.
Add tests for these two cases.
11 years ago
Damien George
b068b21742
Add more tests for multi-precision integers.
11 years ago
Damien George
25f5a30e73
py: Fix overriding of default arguments.
Addresses issue #327 .
11 years ago
Paul Sokolovsky
e74f52b76c
namedtuple: Inherit unary/binary ops from tuple base class.
11 years ago
Paul Sokolovsky
d08fd68664
Add basic collections.namedtuple implementation.
11 years ago
Damien George
06201ff3d6
py: Implement bit-shift and not operations for mpz.
Implement not, shl and shr in mpz library. Add function to create mpzs
on the stack, used for memory efficiency when rhs is a small int.
Factor out code to parse base-prefix of number into a dedicated function.
11 years ago
Paul Sokolovsky
135002a086
Add basic super() test.
11 years ago
Paul Sokolovsky
56e5ef203b
parse: Refactor parse node encoding to support full range of small ints.
Based on suggestion by @dpgeorge at
https://github.com/micropython/micropython/pull/313
11 years ago
Paul Sokolovsky
fb7f94392d
import: Implement "from pkg.mod import sym" syntax properly.
http://docs.python.org/3.3/library/functions.html#__import__ :
"When the name variable is of the form package.module, normally, the
top-level package (the name up till the first dot) is returned, not
the module named by name. However, when a non-empty fromlist argument
is given, the module named by name is returned."
11 years ago
Paul Sokolovsky
ac2e28c654
Support passing positional args as keywords to bytecode functions.
For this, record argument names along with each bytecode function. The code
still includes extensive debug logging support so far.
11 years ago
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
9fce77c993
Add more finally + break/continue testcases.
11 years ago
Paul Sokolovsky
3c95ba7e4e
Add additional testcase for finally/return.
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