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
John R. Lenton
0fcbaa442f
implemented dict.pop
11 years ago
John R. Lenton
cd0887352d
Added dict.get.
11 years ago
John R. Lenton
d90b19eca5
Added dict.copy
11 years ago
John R. Lenton
4ce6ceadca
Added dict.clear.
Added 0 to the list of primes. Funky primes, these.
11 years ago
John R. Lenton
a41fe31322
Added dict iterator.
11 years ago
John R. Lenton
c06763a020
This implements a better (more python-conformant) list.sort.
It's not really about that, though; it's about me figuring out a sane
way forward for keyword-argument functions (and function
metadata). But it's useful as is, and shouldn't break any existing
code, so here you have it; I'm going to park it in my mind for a bit
while sorting out the rest of the dict branch.
11 years ago
Damien George
f0691f4ed5
Fix qstr in objlist.c; add more tests for list.index.
list.index fails on an edge case.
11 years ago
Damien George
11f1e4b8f1
Add test for basic builtin types.
11 years ago
xyb
8cfc9f07b9
Implements str iterator
11 years ago
Paul Sokolovsky
9464cde3c9
Unbreak string slice test by just switching to normal (not byte) strings.
11 years ago
Paul Sokolovsky
21dfb55dad
tests/basics requires python3.3
tests/bytecode/run-tests already uses puthon3.3, so let's just use it here
too.
Fore reference, errors with python 3.2.3:
File "tests/generator1.py", line 12
return None
SyntaxError: 'return' with argument inside generator
File "tests/list_clear.py", line 3, in <module>
x.clear()
AttributeError: 'list' object has no attribute 'clear'
etc.
11 years ago
John R. Lenton
6e1e98f864
Implements list.reverse; fixes issue #66
11 years ago
John R. Lenton
49fb6e53b3
Implements list.remove (in terms of list.index and list.pop).
Fixes issue #63 .
11 years ago
Paul Sokolovsky
6ee1e383d6
str slice: Trim slice indexes to be in range.
11 years ago
John R. Lenton
45a8744617
Implements list.insert. Fixes issue #61 .
11 years ago
Damien George
c8d1384fc0
Fix int -> machine_int_t; add print to slice test.
11 years ago
Paul Sokolovsky
26534cec85
Add test for byte string slicing.
11 years ago
John R. Lenton
5d4a821339
Implements list.index. Fixes issue #57 .
11 years ago
John R. Lenton
e241e8c169
Implemented list.count
11 years ago
John R. Lenton
26c211648b
Implemented list.copy. Fixes issue #54 .
11 years ago
John R. Lenton
069ded9514
Added list.clear. Fixes issue #53 .
11 years ago
John R. Lenton
64427d6ee6
renamed some tests to have better names.
11 years ago
John R. Lenton
25f417c08c
Worked on list.pop:
* Fixes issue #51
* Adds a specific error message for when you try to pop an empty list.
* Releases some memory if the list has shurnk a lot.
11 years ago
Damien George
66028ab6dc
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
11 years ago
John R. Lenton
4cb80582c4
Add list addition ( fixes : #39 )
11 years ago
Damien George
0ff883904a
py: Fix generator where state array was incorrectly indexed.
Generator objects now allocate the object and the state in one malloc.
This improvement fixes Issue #38 .
11 years ago
Damien George
bbabfb40ba
Fix bash->/usr/bin/env bash; add LICENSE for Python library tests.
11 years ago
Damien George
6baf76e28b
py: make closures work.
11 years ago