summaryrefslogtreecommitdiff
path: root/py/builtintables.c
AgeCommit message (Collapse)Author
2014-12-09py: Allow builtins to be overridden.Damien George
This patch adds a configuration option (MICROPY_CAN_OVERRIDE_BUILTINS) which, when enabled, allows to override all names within the builtins module. A builtins override dict is created the first time the user assigns to a name in the builtins model, and then that dict is searched first on subsequent lookups. Note that this implementation doesn't allow deleting of names. This patch also does some refactoring of builtins code, creating the modbuiltins.c file. Addresses issue #959.
2014-11-29modubinascii: Add, with hexlify() implementation.Paul Sokolovsky
2014-11-22moduhashlib: Initial module skeleton.Paul Sokolovsky
2014-10-31py: Add builtin round function.Damien George
Addresses issue #934.
2014-10-25py: Implement compile builtin, enabled only on unix port.Damien George
This should be pretty compliant with CPython, except perhaps for some corner cases to do with globals/locals context. Addresses issue #879.
2014-10-23py: Add builtin memoryview object (mostly using array code).Damien George
2014-10-22extmod: Add uheapq module.Damien George
2014-10-22py: Remove unused and unneeded SystemError exception.Damien George
It's purpose is for internal errors that are not catastrophic (ie not as bad as RuntimeError). Since we don't use it, we don't need it.
2014-10-13modzlibd: Remove, superceded by moduzlib.Paul Sokolovsky
2014-10-12Merge pull request #904 from pfalcon/moduzlibDamien George
Module "uzlib" - based on similarly named library
2014-10-13moduzlib: Integrate into the system.Paul Sokolovsky
2014-10-12py: Add module weak link support.Damien George
With this patch a port can enable module weak link support and provide a dict of qstr->module mapping. This mapping is looked up only if an import fails to find the requested module in the filesystem. This allows to have the builtin module named, eg, usocket, and provide a weak link of "socket" to the same module, but this weak link can be overridden if a file by the name "socket.py" is found in the import path.
2014-10-11modure: Initial module, using re1.5 (which is based on re1 codebase).Paul Sokolovsky
https://github.com/pfalcon/re1.5
2014-09-30py: Remove IOError since it's deprecated; use OSError instead.Damien George
In CPython IOError (and EnvironmentError) is deprecated and aliased to OSError. All modules that used to raise IOError now raise OSError (or a derived exception). In Micro Python we never used IOError (except 1 place, incorrectly) and so don't need to keep it. See http://legacy.python.org/dev/peps/pep-3151/ for background.
2014-09-17py: Add 'builtins' module.Damien George
2014-09-17py: Add native json printing using existing print framework.Damien George
Also add start of ujson module with dumps implemented. Enabled in unix and stmhal ports. Test passes on both.
2014-09-07Remove skeletal modselect from extmod and just put it in stmhal.Damien George
2014-09-07stmhal: Implement generic select.select and select.poll.Damien George
2014-08-16py: Put SystemExit in builtin namespace.Damien George
Also fix unix port so that SystemExit with no arg exits with value 0.
2014-08-13modzlibd: Decompress part of "zlib" module, based on miniz tinfl.c .Paul Sokolovsky
2014-08-12py: Implement builtin reversed() function.Damien George
reversed function now implemented, and works for tuple, list, str, bytes and user objects with __len__ and __getitem__. Renamed mp_builtin_len to mp_obj_len to make it publically available (eg for reversed).
2014-07-09moductypes: Foreign data interface module, roughly based on ctype ideas.Paul Sokolovsky
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.
2014-06-27py: Allow to disable array module and bytearray type.Paul Sokolovsky
array.array and bytearray share big deal of code, so to get real savings, both need to be disabled.
2014-06-21py: Include mpconfig.h before all other includes.Paul Sokolovsky
It defines types used by all other headers. Fixes #691.
2014-06-20py: Separate MICROPY_PY_BUILTINS_COMPLEX from MICROPY_PY_BUILTINS_FLOAT.Paul Sokolovsky
One thing is wanting to do 1 / 2 and get something else but 0, and quite another - doing rocket science ;-).
2014-06-19Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot
2014-06-12py: Rename builtin "io" to "_io".Paul Sokolovsky
Functionality we provide in builtin io module is fairly minimal. Some code, including CPython stdlib, depends on more functionality. So, there's a choice to either implement it in C, or move it _io, and let implement other functionality in Python. 2nd choice is pursued. This setup matches CPython too (_io is builtin, io is Python-level).
2014-06-03py: Properly fix configuration of float and math module.Damien George
2014-06-03py: Fix configuration of math module.Damien George
2014-06-01py: Add option to disable set() object (enabled by default).Damien George
2014-06-01Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George
This renames: MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT See issue #35 for discussion.
2014-05-24Rename configuration variables controling Python features.Damien George
Now of the form MICROPY_PY_*. See issue #35.
2014-05-21Tidy up some configuration options.Damien George
MP_ALLOC_* -> MICROPY_ALLOC_* MICROPY_PATH_MAX -> MICROPY_ALLOC_PATH_MAX MICROPY_ENABLE_REPL_HELPERS -> MICROPY_HELPER_REPL MICROPY_ENABLE_LEXER_UNIX -> MICROPY_HELPER_LEXER_UNIX MICROPY_EXTRA_* -> MICROPY_PORT_* See issue #35.
2014-05-11py: Add basic implementation of hasattr() function.Paul Sokolovsky
2014-05-10objset: Give up and implement frozenset.Paul Sokolovsky
Tired of patching CPython stdlib for it.
2014-05-06modgc: Add new module for GC-related functionality.Paul Sokolovsky
2014-05-03Add license header to (almost) all files.Damien George
Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-04-26Add ARRAY_SIZE macro, and use it where possible.Damien George
2014-04-26py: Make collections module configurable, enabled by default.Damien George
2014-04-17py: Make built-in 'range' a class.Damien George
Addresses issue #487.
2014-04-17py: Add cmath module, for complex math. Disabled by default.Damien George
Not all functions implemented. Not enabled on pyboard.
2014-04-15py: Add builtin functions bin and oct, and some tests for them.Damien George
2014-04-15py: Add hex builtin function.Damien George
A one-liner, added especially for @pfalcon :)
2014-04-13py: Add property object, with basic functionality.Damien George
Enabled by MICROPY_ENABLE_PROPERTY.
2014-04-13py: Add more #if's for configurable MOD_SYS.Damien George
2014-04-13Merge pull request #476 from pfalcon/static-sysDamien George
Convert sys module to static allocation
2014-04-13py: Rename collections module to _collections.Paul Sokolovsky
We're not going to implement all the plethora of types in there in C. Funnily, CPython implements defaultdict in C, and namedtuple in Python.
2014-04-13py, unix: Convert sys module to static representation.Paul Sokolovsky
2014-04-10py: Start implementing "struct" module.Paul Sokolovsky
Only calcsize() and unpack() functions provided so far, for little-endian byte order. Format strings don't support repition spec (like "2b3i"). Unfortunately, dealing with all the various binary type sizes and alignments will lead to quite a bloated "binary" helper functions - if optimizing for speed. Need to think if using dynamic parametrized algos makes more sense.
2014-04-08py: Make bytearray a proper type.Paul Sokolovsky