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
John R. Lenton
7d21d516d2
make dict_len use the map's used count
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
Paul Sokolovsky
24507aff7d
Typo fix in comment.
11 years ago
Paul Sokolovsky
af61a1a492
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
11 years ago
Paul Sokolovsky
1e40840b3b
Add OSError, Python 3.3 generic I/O exception.
11 years ago
John R. Lenton
3391e19068
A bit of stylistic cleanup (chose the wrong side during conflict resolution).
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
7b21c2d8f0
py: Fix allocation of unique code blocks.
11 years ago
Damien George
d3ebe4829d
Factor and simplify Makefile's and mpconfig, part 2.
11 years ago
Damien George
136f67523b
Factor and simplify Makefile's and mpconfig.
11 years ago
ian-v
a5a01df81d
Make list and str method tables static
11 years ago
Damien George
e2e3d11e87
py: Fix up number operations and coercion.
11 years ago
ian-v
5fd8fd2c16
Revert MP_BOOL, etc. and use <stdbool.h> instead
11 years ago
ian-v
7a16fadbf8
Co-exist with C++ (issue #85 )
11 years ago
Paul Sokolovsky
fe039b4f4f
Typo fix in comment.
11 years ago
Paul Sokolovsky
e5ee1693ad
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
11 years ago
John R. Lenton
c553162ebc
Fix off-by-one in non-default values of index's 2nd and 3rd arguments.
11 years ago
Paul Sokolovsky
860ffb0a43
Convert many object types structs to use C99 tagged initializer syntax.
11 years ago
Dave Hylands
d986b582c0
Make qstr_init reinitialize last_pool.
This causes the pool to get reinitialized properly on a soft-reset.
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
xyb
8cfc9f07b9
Implements str iterator
11 years ago
Damien George
45b43c21c4
Oops: add objint.c
11 years ago
Damien George
71c5181a8d
Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
11 years ago
Mikael Eiman
d67091371d
OSX: fixes to make nlrx64.S with Apple's clang (switched to Apple-specific define instead of __llvm__)
11 years ago
Mikael Eiman
f53cdd947c
OSX: fixes to make nlrx64.S with Apple's clang (forgot a few places)
11 years ago
Mikael Eiman
5d02e2d6fa
OSX: fixes to make nlrx64.S with Apple's clang
11 years ago
Damien George
e9906ac3d7
Add ellipsis object.
11 years ago
Damien George
eb7bfcb286
Split qstr into pools, and put initial pool in ROM.
Qstr's are now split into a linked-list of qstr pools. This has 2
benefits: the first pool can be in ROM (huge benefit, since we no longer
use RAM for the core qstrs), and subsequent pools use m_new for the next
pool instead of m_renew (thus avoiding a huge single table for all the
qstrs).
Still would be better to use a hash table, but this scheme takes us part
of the way (eventually convert the pools to hash tables).
Also fixed bug with import.
Also improved the way the module code is referenced (not magic number 1
anymore).
11 years ago
Damien George
e67ed5d285
Improve configurability for native x64/thumb emitter.
With MICROPY_EMIT_X64 and MICROPY_EMIT_THUMB disabled, the respective
emitters and assemblers will not be included in the code. This can
significantly reduce binary size for unix version.
11 years ago