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
Damien George
69a818d418
py: Improve memory management for parser; add lexer error for bad line cont.
11 years ago
Damien George
e5863d9301
py: AssertionError is loaded from global, to match CPython.
11 years ago
Paul Sokolovsky
1945e60aeb
list: Implement comparison operators.
11 years ago
Paul Sokolovsky
cc57bd2663
mp_obj_equal(): For non-trivial types, call out to type's special method.
11 years ago
Paul Sokolovsky
729e9cce7b
rt_binary_op(): Don't fall thru in case small_int op result doesn't fit back.
Currently it would report "operation not supported" which is confusing. Overall,
this is thinko leading to undefined behavior.
11 years ago
Paul Sokolovsky
c698d266d1
list: Add extend() methods and += operator.
11 years ago
Paul Sokolovsky
b81e1fdef7
Add AssertionError.
11 years ago
Damien George
eae16445d5
py: Implement staticmethod and classmethod (internally).
Still need to make built-ins by these names, and write tests.
11 years ago
John R. Lenton
c1bef21920
Implemented support for `in` and `not in` operators.
11 years ago
Damien George
bcbeea0a47
py: Fix bug where == and != not handled for small_ints.
11 years ago
Damien George
bc1d36924d
py: Fix emitcpy and emitnative's binary_op.
11 years ago
Damien George
25042b19d2
py: Make arg to MP_BC_RAISE_VARARGS a byte.
11 years ago
John R. Lenton
b8698fca75
unified the bops
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
Paul Sokolovsky
bab5cfb34f
Unsupported operand types for binary operator: dump both args' types.
11 years ago
Paul Sokolovsky
d6f27fe317
mp_obj_equal(): Print which types' equality not implemented before assert().
11 years ago
Paul Sokolovsky
e06edce786
mp_repl_is_compound_stmt(): Thinko fix s/true/try/.
11 years ago
Paul Sokolovsky
4b919d0135
Dump few more bytecodes (based on attempt to run real-world code).
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
2d45429122
Use memcpy instead of strncpy; add usart.status to stm.
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
xbe
7b0f39f318
Implement str.strip
11 years ago
Damien George
93a9b5b64d
py: Proper framework for built-in 'type'.
11 years ago
Dave Hylands
4646801181
Make build output quieter.
Use make V=1e make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
This should fix issue #117
11 years ago
Damien George
6c73ca1e75
py: add variable argument exception constructor function.
Addresses issue #104 .
11 years ago
Damien George
38a2da68c2
py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.
11 years ago
Paul Sokolovsky
e98cf40c34
Add generic implementations of Python read()/write methods for streams.
These can be used for any object which implements stream protocol
(mp_stream_p_t).
11 years ago
Paul Sokolovsky
5b15daf6d1
Add support for stream and buffer protocols.
Stream protocol is abstraction of serial I/O. Buffer protocol is
abstraction of random-access I/O. These protocols are defined down
to C level, to allow generic, while still efficient algorithms
to be coded in C (like, buffered transfer between 2 stream objects,
saving/loading of buffer object to/from stream, etc). (Note that CPython
define buffer protocol on C level, but apparently not stream protocol).
11 years ago
Damien George
9193f89296
Move lexerstr to main py directory (everyone uses it).
11 years ago
Damien George
b97669ab94
py: Improve __build_class__.
11 years ago
Damien George
dfc0bac086
py: Small big fix to type declarations.
11 years ago
John R. Lenton
baa665406f
Moved dict methods out to a mp_method_t.
11 years ago
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
John R. Lenton
88f3043e0a
added a first pass of dict.update
11 years ago
Damien George
1a9951d5aa
py: Fix up number operations and coercion.
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