summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.h
Commit message (Collapse)AuthorAge
...
* Implement slicing for lists.Paul Sokolovsky2014-02-02
|
* Factor out m_seq_get_fast_slice_indexes() fucntions as sequence helper.Paul Sokolovsky2014-02-02
| | | | | Takes slice object and sequence length and computes subsequence indexes for case of slice step=1.
* Implement default function arguments (for Python functions).Paul Sokolovsky2014-02-01
| | | | | | | | TODO: Decide if we really need separate bytecode for creating functions with default arguments - we would need same for closures, then there're keywords arguments too. Having all combinations is a small exponential explosion, likely we need just 2 cases - simplest (no defaults, no kw), and full - defaults & kw.
* py: Simplify fastn in VM; reduce size of unique code struct.Damien George2014-01-29
| | | | | | | | | | We still have FAST_[0,1,2] byte codes, but they now just access the fastn array (before they had special local variables). It's now simpler, a bit faster, and uses a bit less stack space (on STM at least, which is most important). The only reason now to keep FAST_[0,1,2] byte codes is for compressed byte code size.
* mp_obj_new_bytearray_by_ref(): Allow to create array by reference.Paul Sokolovsky2014-01-29
| | | | This is special feature for FFI.
* Factor out quoted string print function for reuse (mp_str_print_quoted()).Paul Sokolovsky2014-01-28
|
* Add MP_OBJ_IS_INT(), for symmetry with MP_OBJ_IS_STR().Paul Sokolovsky2014-01-26
|
* Implement mp_parse_node_free; print properly repr(string).Damien George2014-01-25
|
* py: Implement iterator support for object that has __getitem__.Damien George2014-01-25
| | | | Addresses Issue #203.
* Add basic implementation of bytes type, piggybacking on str.Paul Sokolovsky2014-01-24
| | | | | This reuses as much str implementation as possible, from this we can make them more separate as needed.
* Second stage of qstr revamp: uPy str object can be qstr or not.Damien George2014-01-22
|
* Add len() support for arrays.Paul Sokolovsky2014-01-21
|
* sequence.c: Start to refactor sequence operations for reuse among types.Paul Sokolovsky2014-01-21
|
* mp_identity(): Add generic identity function.Paul Sokolovsky2014-01-20
| | | | Useful as getiter method for objects which are their own iterators, etc.
* Properly print MP_OBJ_QSTR objects.Paul Sokolovsky2014-01-20
|
* Implement modules as singletons Python semantics.Paul Sokolovsky2014-01-20
| | | | | | | | | | | | In Python, importing module several times returns same underlying module object. This also fixes import statement handling for builtin modules. There're still issues: 1. CPython exposes set of loaded modules as sys.modules, we may want to do that either. 2. Builtin modules are implicitly imported, which is not really correct. We should separate registering a (builtin) module and importing a module. CPython keeps builtin module names in sys.builtin_module_names .
* Change int to uint for n_args in function with variable arguments.Damien George2014-01-19
|
* py: Add full traceback to exception printing.Damien George2014-01-19
|
* py: Add module/function/class name to exceptions.Damien George2014-01-19
| | | | | | | Exceptions know source file, line and block name. Also tidy up some debug printing functions and provide a global flag to enable/disable them.
* Merge pull request #192 from pfalcon/arraysDamien George2014-01-18
|\ | | | | Add skeleton implementation of array.array and bytearray.
| * Add skeleton implementation of array.array and bytearray.Paul Sokolovsky2014-01-18
| | | | | | | | | | So far, only storage, initialization, repr() and buffer protocol is implemented - alredy suitable for passing binary data around.
* | Add source file name and line number to error messages.Damien George2014-01-18
|/ | | | | Byte code has a map from byte-code offset to source-code line number, used to give better error messages.
* Merge pull request #191 from pfalcon/store-itemDamien George2014-01-18
|\ | | | | Add store_item() virtual method to type to implement container[index] = val
| * Add store_item() virtual method to type to implement container[index] = val.Paul Sokolovsky2014-01-18
| |
* | Merge branch 'master' of github.com:dpgeorge/micropythonDamien George2014-01-18
|\ \
| * | int: Add value accessors: mp_obj_int_get() & mp_obj_int_get_checked().Paul Sokolovsky2014-01-18
| |/ | | | | | | | | | | mp_obj_int_get() can be used when just full resolution of C machine_int_t is required (returns truncated value of long int). mp_obj_int_get_checked() will throw exception if Python int value not representable in machine_int_t.
* / Make VM stack grow upwards, and so no reversed args arrays.Damien George2014-01-18
|/ | | | | | | | | | | | | | | Change state layout in VM so the stack starts at state[0] and grows upwards. Locals are at the top end of the state and number downwards. This cleans up a lot of the interface connecting the VM to C: now all functions that take an array of Micro Python objects are in order (ie no longer in reverse). Also clean up C API with keyword arguments (call_n and call_n_kw replaced with single call method that takes keyword arguments). And now make_new takes keyword arguments. emitnative.c has not yet been changed to comply with the new order of stack layout.
* stm: Fix print methods with new kind argument.Damien George2014-01-15
|
* Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2intDamien George2014-01-15
|\ | | | | | | | | | | | | Conflicts: py/objint.c unix-cpy/Makefile unix/Makefile
| * Implemented int(str) in UNIXxyb2014-01-14
| |
* | Merge branch 'str-repr' of github.com:pfalcon/micropython into pfalcon-str-reprDamien George2014-01-15
|\ \ | | | | | | | | | | | | Conflicts: tests/basics/tests/exception1.py
| * | type->print(): Distinguish str() and repr() variety by passing extra param.Paul Sokolovsky2014-01-15
| | |
* | | added filter()John R. Lenton2014-01-15
| | |
* | | Added mapJohn R. Lenton2014-01-15
| | |
* | | Merge remote-tracking branch 'upstream/master' into builtinsJohn R. Lenton2014-01-14
|\| |
| * | Tidy up.Damien George2014-01-14
| | |
* | | added enumerate()John R. Lenton2014-01-14
|/ /
* | Made sorted() raise an exception instead of aborting when given no ↵John R. Lenton2014-01-13
| | | | | | | | arguments; moved around some things in objfun.c as a consequence
* | Cleaned up sorted() as per Damien's suggestions.John R. Lenton2014-01-13
| |
* | added zip()John R. Lenton2014-01-13
| |
* | Add framework to support alternative implementations of long int Python type.Paul Sokolovsky2014-01-12
| |
* | Add proper checks for fits-in-small-int. Make it reusable.Paul Sokolovsky2014-01-12
|/ | | | | | | 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.
* py: Implement staticmethod and classmethod (internally).Damien George2014-01-11
| | | | Still need to make built-ins by these names, and write tests.
* unified the bopsJohn R. Lenton2014-01-11
|
* Added dict.fromkeys. Are we done with dict and #99 yet? I do think we are.John R. Lenton2014-01-10
|
* py: Implement base class lookup, issubclass, isinstance.Damien George2014-01-09
|
* Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.Damien George2014-01-09
| | | | | Creating of classes (types) and instances is much more like CPython now. You can use "type('name', (), {...})" to create classes.
* py: add variable argument exception constructor function.Damien George2014-01-08
| | | | Addresses issue #104.
* Merge pull request #114 from pfalcon/streams-bootstrapDamien George2014-01-08
|\ | | | | Define buffer and stream protocols, and other starting bits of io.* framework, with io.FileIO-like implementation for Unix
| * Add support for stream and buffer protocols.Paul Sokolovsky2014-01-08
| | | | | | | | | | | | | | | | | | 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).