aboutsummaryrefslogtreecommitdiff
path: root/py/runtime.c
AgeCommit message (Collapse)Author
2014-03-22py: Make 'bytes' be a proper type, support standard constructor args.Paul Sokolovsky
2014-03-22py: Make 'str' be a proper type, support standard constructor args.Paul Sokolovsky
2014-03-21py: Allow 'complex()' to take a string as first argument.Damien George
2014-03-21py: Implement parsing of infinity and nan for floats.Damien George
2014-03-17py: Clean up includes.xbe
Remove unnecessary includes. Add includes that improve portability.
2014-03-12py: Implement integer overflow checking for * and << ops.Damien George
If operation will overflow, a multi-precision integer is created.
2014-03-09py: Fix printing of type name.Damien George
2014-03-08Implement ROMable modules. Add math module.Damien George
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).
2014-03-03py: Factor and improve issubclass.Damien George
2014-03-03Add basic collections.namedtuple implementation.Paul Sokolovsky
2014-02-26py: Remove more var arg names fro macros with var args.Damien George
2014-02-26py: Take out bitfield entries from their own structure.Damien George
Don't need to wrap bitfields in their own struct. Compiler does the correct thing without it.
2014-02-22py: Put number parsing code together in parsenum.c.Damien George
2014-02-16Support passing positional args as keywords to bytecode functions.Paul Sokolovsky
For this, record argument names along with each bytecode function. The code still includes extensive debug logging support so far.
2014-02-16Make DEBUG_printf() a proper function, implementation is port-dependent.Paul Sokolovsky
In particular, unix outputs to stderr, to allow to run testsuite against micropython built with debug output (by redirecting stderr to /dev/null).
2014-02-16py: Implement *vargs support.Damien George
Addresses issue #295.
2014-02-15py: Improve exception bases, reduces ROM usage.Damien George
Thanks to @pfalcon for the tip!
2014-02-15py: Pass all scope flags through to runtime.Damien George
2014-02-15Implement proper exception type hierarchy.Damien George
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.
2014-02-14Merge pull request #288 from pfalcon/port-builtinsDamien George
Allow ports to define statically builtin functions.
2014-02-14Allow ports to define statically builtin functions.Paul Sokolovsky
Convert unix open() to such.
2014-02-14Implement "from module import *" construct.Paul Sokolovsky
2014-02-12Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky
2014-02-10Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-02-09Add NotImplementedError.Paul Sokolovsky
2014-02-08py: Add some qstrs to the global table.Damien George
2014-02-06py: Put builtins into ROM table.Damien George
Linear table at the moment, to eventually be replaced with a hash table generated by a preprocessor. Dynamic table is retained so that builtins can be overridden.
2014-02-06Add staticmethod and classmethod to builtin namespace.Damien George
2014-02-05Merge pull request #262 from pfalcon/sys-pathDamien George
Implement sys.path support
2014-02-05py: Add built-in super.Damien George
2014-02-05Implement support for sys.path when loading modules.Paul Sokolovsky
sys.path is not initialized by rt_init(), that's left for platform-specific startup code. (For example, bare metal port may have some hardcoded defaults, and let user change sys.path directly; while port for OS with environment feature can take path from environment). If it's not explicitly initialized, modules will be imported only from a current directory.
2014-02-04Use qstr id to create sys module.Paul Sokolovsky
2014-02-04Add ImportError.Paul Sokolovsky
2014-02-04Expose __import__() function.Paul Sokolovsky
2014-02-03py: Implement builtin exec.Damien George
2014-02-02py: Add very basic implementation of dir() builtin.Damien George
Only works on modules and class instances.
2014-02-02Merge branch 'xbe-master'Damien George
2014-02-02Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-02-02py: Partially fix native emitter to work with latest runtime.Damien George
Native emitter has been broken since stack order has changed from reverse to standard. This fix gets it partially working.
2014-02-01Implement and add tests for the id() builtin function.xbe
2014-02-02rt_unpack_sequence(): Support generic iterables.Paul Sokolovsky
2014-02-01Tidy up some comments.Damien George
2014-02-01py: Tidy up BINARY_OPs; negation done by special NOT bytecode.Damien George
IS_NOT and NOT_IN are now compiled to IS + NOT and IN + NOT, with a new special NOT bytecode.
2014-02-01Implement default function arguments (for Python functions).Paul Sokolovsky
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.
2014-01-31py: Simplified rt_call_function_n_kw.Damien George
2014-01-31Fix SIGSEV when running "a"()Markus Siemens
rt_call_function_n_kw did check for integers but not for strings being called. Added a check so running "a"() won't SIGSEV but throw an exception.
2014-01-31py: Add MICROPY_ENABLE_FLOAT around a float specific piece of code.Damien George
2014-01-30py: Improve __bool__ and __len__ dispatch; add slots for them.Damien George
2014-01-30Implement __bool__ and __len__ via unary_op virtual method for all types.Paul Sokolovsky
__bool__() and __len__() are just the same as __neg__() or __invert__(), and require efficient dispatching implementation (not requiring search/lookup). type->unary_op() is just the right choice for this short of adding standalone virtual method(s) to already big mp_obj_type_t structure.
2014-01-29py: Simplify fastn in VM; reduce size of unique code struct.Damien George
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.