Paul Sokolovsky
8c3858b016
Move tests in basic/tests/ up one level preparating to multiple test dirs.
11 years ago
Damien George
ebde0b8a09
Tiny optimisation in objlist.c; a new test for inheritance.
11 years ago
Damien George
f49ba1bd9c
Improve method lookup in mp_obj_class_lookup.
Now searches both locals_dict and methods. Partly addresses Issue #145 .
11 years ago
Paul Sokolovsky
b31b5e0b5c
Add testcase for subclassing builtin type and calling native method (broken).
11 years ago
Damien George
1d6fc94c16
Implement framework for class-defined built-in operators.
Now working for class-defined methods: __getitem__, __setitem__,
__add__, __sub__. Easy to add others.
11 years ago
Paul Sokolovsky
10744dd816
Add empty (false) value testing for strings, tuples, lists, dicts.
11 years ago
Paul Sokolovsky
f2b796e7c7
str.format: Don't assume that '}' immediately follows '{', skip insides.
That at least makes stuff like "{:x}".format(1) to produce not completely
broken output.
11 years ago
Damien George
d02c6d8962
Implement eval.
11 years ago
Damien George
e2fb2baaa4
Implement repr.
11 years ago
xyb
3e4ed25138
add more tests and remove debug code
11 years ago
xyb
3270fb4be6
int() test passed
11 years ago
John R. Lenton
fca456bc3c
added filter()
11 years ago
John R. Lenton
39b174e00a
Added map
11 years ago
Paul Sokolovsky
76d982ef34
type->print(): Distinguish str() and repr() variety by passing extra param.
11 years ago
John R. Lenton
9daa78943e
added enumerate()
11 years ago
Paul Sokolovsky
8bc96471f0
Implement "is" and "is not" operators.
So far, don't work for strings as expected.
11 years ago
Paul Sokolovsky
ddf2178d83
Refactor exception objects to have better impl of Python-side interface.
This implements internal args tuple of arguments, while still keeping
object useful for reporting C-side errors.
Further elaboration is needed.
11 years ago
xyb
c178ea471e
Implemented int(str) in UNIX
11 years ago
John R. Lenton
5c76839559
sorted
11 years ago
John R. Lenton
07205ec323
added zip()
11 years ago
John R. Lenton
7244a14439
oops, nasty off-by-one in set_copy
11 years ago
John R. Lenton
be790f94d5
Implemented set binary ops.
11 years ago
John R. Lenton
e820491f7a
Implement a basic str.find; fixes #67
11 years ago
Paul Sokolovsky
757ac81a69
Add proper checks for fits-in-small-int. Make it reusable.
We likely should make mp_obj_new_int() inline, and rely on its
encapsulated check rather than inline checks everywhere explicitly.
Also, parser for big small int values is still broken.
11 years ago
John R. Lenton
0de386bffe
Implemented set.update
11 years ago
John R. Lenton
ae00d334c6
Implemented set.remove
11 years ago
John R. Lenton
4a08067c0c
Implemented set.isdisjoint
11 years ago
John R. Lenton
f1ae6b48fb
Implemented set.intersection and set.intersection_update
11 years ago
John R. Lenton
032129f3b5
Implemented set.difference and set.difference_update
11 years ago
John R. Lenton
2a24172cdc
Implemented set.discard
11 years ago
John R. Lenton
3b0bd87906
Implemented set.copy
11 years ago
John R. Lenton
1d7fb2f21b
Implemented set.clear
11 years ago
John R. Lenton
19b14d3d8a
Implemented set.add
11 years ago
John R. Lenton
0ce03b48a0
make sets iterable
11 years ago
Paul Sokolovsky
1945e60aeb
list: Implement comparison operators.
11 years ago
Paul Sokolovsky
c698d266d1
list: Add extend() methods and += operator.
11 years ago
John R. Lenton
c1bef21920
Implemented support for `in` and `not in` operators.
11 years ago
Paul Sokolovsky
899c69f94c
compile_for_stmt_optimised_range(): Properly handle negative & unknown steps.
If step is not constant, in first approximation, we can't apply optimization,
(well, we could, but need a special case for this).
11 years ago
Paul Sokolovsky
5388a3c29a
Crude attempt to implement RAISE_VARARGS (with args=1 so far only).
11 years ago
Paul Sokolovsky
074d3b5f86
list: Implement list multiplication.
11 years ago
John R. Lenton
4bee76ebca
Added dict.fromkeys. Are we done with dict and #99 yet? I do think we are.
11 years ago
John R. Lenton
9ec3a87189
dict views now, refactoring later.
11 years ago
Damien George
004cdcebfe
py: Implement base class lookup, issubclass, isinstance.
11 years ago
Damien George
062478e66d
Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.
Creating of classes (types) and instances is much more like CPython now.
You can use "type('name', (), {...})" to create classes.
11 years ago
Paul Sokolovsky
926d2b621e
Count individual testcases when running tests.
The idea is simple: each print represents a testcase within a test unit.
As we don't have strict rules on which/how many testcase are put into
a test file, it's nice to have an idea how many *testcases* we have
totally. Would be nice to count how many testcases pass/fail, but
that's a bit less trivial.
11 years ago
Paul Sokolovsky
d944a66ead
Add string comparison tests.
Use computed string to exercise string interning code better.
11 years ago
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
John R. Lenton
27d4ca7693
forgot to add test for dict.update
11 years ago
John R. Lenton
be8fe5be2e
Added dict.setdefault
11 years ago
John R. Lenton
f77dce8a5d
Added dict.popitem
11 years ago