summaryrefslogtreecommitdiffstatshomepage
path: root/py/obj.h
Commit message (Collapse)AuthorAge
...
* | vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).Paul Sokolovsky2014-03-30
|/
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* Rename rt_* to mp_*.Damien George2014-03-30
| | | | | | | Mostly just a global search and replace. Except rt_is_true which becomes mp_obj_is_true. Still would like to tidy up some of the names, but this will do for now.
* py: Rename old const type objects to mp_type_* for consistency.Damien George2014-03-29
|
* py: Change mp_const_* objects to macros.Damien George2014-03-29
| | | | Addresses issue #388.
* objgenerator: close(): Throw instance of GeneratorExit (not type).Paul Sokolovsky2014-03-28
| | | | | To comply with Python semantics and allow use of mp_obj_is_subclass_fast() for exception matching.
* py: Thin out predefined exceptions.Damien George2014-03-27
| | | | | Only exceptions that are actually used are left prefedined. Hierarchy is still there, and removed exceptions are just commented out.
* py: Put n_state for bytecode in the bytecode prelude.Damien George2014-03-27
| | | | | | | | | | | Rationale: setting up the stack (state for locals and exceptions) is really part of the "code", it's the prelude of the function. For example, native code adjusts the stack pointer on entry to the function. Native code doesn't need to know n_state for any other reason. So putting the state size in the bytecode prelude is sensible. It reduced ROM usage on STM by about 30 bytes :) And makes it easier to pass information about the bytecode between functions.
* Remove mp_obj_type_t.methods entry and use .locals_dict instead.Damien George2014-03-26
| | | | | | | | | | | | | | | | | | | | | | Originally, .methods was used for methods in a ROM class, and locals_dict for methods in a user-created class. That distinction is unnecessary, and we can use locals_dict for ROM classes now that we have ROMable maps. This removes an entry in the bloated mp_obj_type_t struct, saving a word for each ROM object and each RAM object. ROM objects that have a methods table (now a locals_dict) need an extra word in total (removed the methods pointer (1 word), no longer need the sentinel (2 words), but now need an mp_obj_dict_t wrapper (4 words)). But RAM objects save a word because they never used the methods entry. Overall the ROM usage is down by a few hundred bytes, and RAM usage is down 1 word per user-defined type/class. There is less code (no need to check 2 tables), and now consistent with the way ROM modules have their tables initialised. Efficiency is very close to equivaluent.
* Change mp_method_t.name from const char * to qstr.Damien George2014-03-26
| | | | Addresses issue #377.
* py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.Damien George2014-03-26
|
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-03-26
|\
| * objexcept: Add mp_obj_exception_get_value() convenience function.Paul Sokolovsky2014-03-26
| | | | | | | | | | | | | | This gets "value" of exceptions in the sense as it's defined for StopIteration.value (i.e. args[0] or None). TODO: This really should be inline function.
* | Merge branch 'gen-close-ret-val' of github.com:pfalcon/micropython into ↵Damien George2014-03-26
|\ \ | | | | | | | | | pfalcon-gen-close-ret-val
| * | objgenerator: Implement return with value and .close() method.Paul Sokolovsky2014-03-26
| | | | | | | | | | | | | | | | | | Return with value gets converted to StopIteration(value). Implementation keeps optimizing against creating of possibly unneeded exception objects, so there're considerable refactoring to implement these features.
* | | py: Add support for user-defined iterators via __iter__, __next__.Damien George2014-03-26
| |/ |/|
* | py: Removed some unnecessary exception objects.Damien George2014-03-25
| | | | | | | | | | They still exist in commented-out form in objexcept.c if they are ever needed.
* | Proper support for registering builtin modules in ROM.Damien George2014-03-25
| | | | | | | | | | Comes with some refactoring of code and renaming of files. All modules are now named mod*.[ch].
* | Merge pull request #373 from iabdalkader/module_registerDamien George2014-03-25
|\ \ | | | | | | Add mp_obj_module_register
| * | Add mp_obj_module_registermux2014-03-25
| |/ | | | | | | | | * Add function to load static modules. * Use module_register to pyb module.
* / py: Remove obsolete declarations; make mp_obj_get_array consistent.Damien George2014-03-24
|/
* py: Add 'object' object.Damien George2014-03-22
|
* py: Add function to convert long int to float.Damien George2014-03-22
|
* Added exception hierarchy except for OSError and UnicodeError (requires ↵Rachel Dowdall2014-03-22
| | | | arguments). Comment out the errors that aren't needed if memory becomes an issue.
* Added ZeroDivisionError to float division.Rachel Dowdall2014-03-20
|
* py: Allow hashing of functions and tuples.Damien George2014-03-20
|
* Implement str.count and add tests for it.xbe2014-03-12
| | | | | | | Also modify mp_get_index to accept: 1. Indices that are or evaluate to a boolean. 2. Slice indices. Add tests for these two cases.
* py: Implement integer overflow checking for * and << ops.Damien George2014-03-12
| | | | If operation will overflow, a multi-precision integer is created.
* Implement ROMable modules. Add math module.Damien George2014-03-08
| | | | | | | | | | mp_module_obj_t can now be put in ROM. Configuration of float type is now similar to longint: can now choose none, float or double as the implementation. math module has basic math functions. For STM port, these are not yet implemented (they are just stub functions).
* py: Factor and improve issubclass.Damien George2014-03-03
|
* Add mp_obj_is_subclass_fast() - intended for fast argument checking.Paul Sokolovsky2014-03-03
| | | | I.e. as replacement of MP_OBJ_IS_TYPE(), which takes into account subclassing.
* py: Reduce size of mp_obj_fun_native_t struct by packing ints.Damien George2014-02-26
|
* py: Take out bitfield entries from their own structure.Damien George2014-02-26
| | | | | Don't need to wrap bitfields in their own struct. Compiler does the correct thing without it.
* py: Remove name of var arg from macros with var args.Damien George2014-02-26
|
* Add arbitrary precision integer support.Damien George2014-02-22
| | | | | Some functionality is still missing (eg and, or, bit shift), and some things are buggy (eg subtract).
* Support passing positional args as keywords to bytecode functions.Paul Sokolovsky2014-02-16
| | | | | For this, record argument names along with each bytecode function. The code still includes extensive debug logging support so far.
* py: Implement *vargs support.Damien George2014-02-16
| | | | Addresses issue #295.
* Implement proper exception type hierarchy.Damien George2014-02-15
| | | | | | | | | | | | | | Each built-in exception is now a type, with base type BaseException. C exceptions are created by passing a pointer to the exception type to make an instance of. When raising an exception from the VM, an instance is created automatically if an exception type is raised (as opposed to an exception instance). Exception matching (RT_BINARY_OP_EXCEPTION_MATCH) is now proper. Handling of parse error changed to match new exceptions. mp_const_type renamed to mp_type_type for consistency.
* Change mp_obj_type_t.name from const char * to qstr.Damien George2014-02-15
| | | | | | Ultimately all static strings should be qstr. This entry in the type structure is only used for printing error messages (to tell the type of the bad argument), and printing objects that don't supply a .print method.
* Remove mp_obj_new_exception_msg_1_arg and _2_arg.Damien George2014-02-12
|
* Factor out mp_seq_count_obj() and implement tuple.count().Paul Sokolovsky2014-02-10
|
* Factor out mp_seq_index_obj() function to implement .index() on sequences.Paul Sokolovsky2014-02-10
|
* Implement tuple addition.Paul Sokolovsky2014-02-08
|
* Refactor list comparison code to mp_seq_cmp_objs().Paul Sokolovsky2014-02-08
|
* unix microsocket: Add dummy makefile() method.Paul Sokolovsky2014-02-08
| | | | | | Unlike CPython socket, microsocket object already implements stream protocol (read/write methods), so makefile() just returns object itself. TODO: this doesn't take care of arguments CPython's makefile() may accept.
* Make mp_obj_str_get_data return char* instead of byte*.Damien George2014-02-08
| | | | | Can't decide which is better for string type, char or byte pointer. Changing to char removes a few casts. Really need to do proper unicode.
* Add staticmethod and classmethod to builtin namespace.Damien George2014-02-06
|
* py: Add built-in super.Damien George2014-02-05
|
* Fix thinko with how bitfields were added to mp_obj_fun_native_t.Paul Sokolovsky2014-02-02
| | | | Structure is back to expected 16 bytes.
* Implement str/bytes rich comparisons.Paul Sokolovsky2014-02-02
|