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
John R. Lenton
b8698fca75
unified the bops
11 years ago
Paul Sokolovsky
bab5cfb34f
Unsupported operand types for binary operator: dump both args' types.
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
Damien George
93a9b5b64d
py: Proper framework for built-in 'type'.
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
Damien George
b97669ab94
py: Improve __build_class__.
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
Paul Sokolovsky
1e40840b3b
Add OSError, Python 3.3 generic I/O exception.
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
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
Damien George
71c5181a8d
Convert Python types to proper Python type hierarchy.
Now much more inline with how CPython does types.
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
14f945c2ca
Add note about implementing inplace operators.
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
Damien George
2870862601
Add module object, to be used eventually for import.
11 years ago
Damien George
40563d56bd
py: Add framework for built-in "type()" function.
11 years ago
Damien George
209d1b1835
py: add int() and float() built-ins, partially implemented.
11 years ago
Damien George
6baf76e28b
py: make closures work.
11 years ago
Damien George
8cc96a35e5
Put unicode functions in unicode.c, and tidy their names.
11 years ago
Damien
dae7eb7226
py: add dict length function, and fix rt_store_set.
11 years ago
Damien
b86e3f9293
py: implement some basic exception matching.
11 years ago
Damien
d9d6201b52
py: simplify __next__ method for generators.
11 years ago
Damien
d99b05282d
Change object representation from 1 big union to individual structs.
A big change. Micro Python objects are allocated as individual structs
with the first element being a pointer to the type information (which
is itself an object). This scheme follows CPython. Much more flexible,
not necessarily slower, uses same heap memory, and can allocate objects
statically.
Also change name prefix, from py_ to mp_ (mp for Micro Python).
11 years ago
Damien
a3dcd9e80c
py: add more Python built-in functions.
11 years ago
Damien
660365e14c
py: split runtime into map, obj, builtin.
11 years ago
Damien
9ecbcfff99
py: work towards working closures.
11 years ago
Damien
db4c361f1c
py: add skeletal import functionality.
11 years ago
Damien
033d17a633
py: built-in range now accepts variable number of arguments.
11 years ago
Damien
86c7fc7dd9
py: add list pop and sort, unpack_sequence, and keywords in method_call.
11 years ago
Damien
d47f9d5a4f
py: add call to __init__ when instantiating class object.
11 years ago
Damien
f03001f8a6
Add function to decode and show byte code.
11 years ago
Damien
0446a0d76d
Change some debugging/output messages for native code generation.
11 years ago
Damien
6b92d451b2
Add len and subscr (a hack) support for strings.
11 years ago
Damien
5bf32c3b6b
Built-in print function supports variable number of arguments.
11 years ago
Damien
40fdfe3000
Improve allocation of stack for byte code.
11 years ago
Damien
03c9cfb015
Make byte code jumps relative.
11 years ago
Damien
96a0addb18
Fixup include of stdarg and va_list definition.
11 years ago
Damien
2f06c57f8a
Add simple var-arg functions; add simple string.format.
11 years ago
Damien
33af3bf028
Change Py API names, py_get_* -> py_obj_get_*.
11 years ago
Damien
d57eba51e5
Add user object to runtime.
11 years ago