summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-05-11py: Give up and make mp_obj_str_get_data() deal with bytes too.Paul Sokolovsky
This is not fully correct re: error handling, because we should check that that types are used consistently (only str's or only bytes), but magically makes lot of functions support bytes.
2014-05-11objstr: Make *strip() accept bytes.Paul Sokolovsky
2014-05-11objtuple: Go out of the way to support comparison of subclasses.Paul Sokolovsky
Two things are handled here: allow to compare native subtypes of tuple, e.g. namedtuple (TODO: should compare type too, currently compared duck-typedly by content). Secondly, allow user sunclasses of tuples (and its subtypes) be compared either. "Magic" I did previously in objtype.c covers only one argument (lhs is many), so we're in trouble when lhs is native type - there's no other option besides handling rhs in special manner. Fortunately, this patch outlines approach with fast path for native types.
2014-05-11py: Don't try to "bind" types store as attributes of objects.Paul Sokolovsky
This was hit when trying to make urlparse.py from stdlib run. Took quite some time to debug. TODO: Reconsile bound method creation process better, maybe callable is to generic type to bind at all?
2014-05-11objstr: Make .[r]partition() work with bytes.Paul Sokolovsky
2014-05-11objboundmeth: If detailed reporting enabled, print object content.Paul Sokolovsky
Similar to closure and cell.
2014-05-11py: Start making good use of mp_const_obj_t.Paul Sokolovsky
2014-05-10objlist: Support list slice deletion.Paul Sokolovsky
2014-05-10objlist: Implement non-growing slice assignment.Paul Sokolovsky
Slice value to assign can be only a list so far too.
2014-05-10py: Fix prefix on few sequence helpers, was incorrectly "mp_".Paul Sokolovsky
2014-05-10objtype: Comments for duplicating code in runtime.c.Paul Sokolovsky
2014-05-10objtype: Implement ->getiter() method for instances.Paul Sokolovsky
Includes support for native bases.
2014-05-10py: Make mp_obj_print() handle null object w/o segfault if debug build.Paul Sokolovsky
Happens regularly when used for debugging.
2014-05-10objnamedtuple: Support iteration.Paul Sokolovsky
2014-05-10py: Compress a little the bytecode emitter structure.Damien George
2014-05-10py, emitters: Fix dummy_data size for bytecode and thumb.Damien George
Thumb uses a bit less RAM, bytecode uses a tiny bit more, to avoid overflow of the dummy buffer in certain cases. Addresses issue #599.
2014-05-10Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-05-10objstr: Implement .lower() and .upper().Paul Sokolovsky
2014-05-10py, lexer: Add allocation policy config; return NULL if can't allocate.Damien George
2014-05-10py: Improve handling of memory error in parser.Damien George
Parser shouldn't raise exceptions, so needs to check when memory allocation fails. This patch does that for the initial set up of the parser state. Also, we now put the parser object on the stack. It's small enough to go there instead of on the heap. This partially addresses issue #558.
2014-05-10builtinimport: Fix broken namespace imports due to dup vstr_cut_tail_bytes().Paul Sokolovsky
2014-05-10builtinimport: Fix comment orphaned by one of previous commits.Paul Sokolovsky
2014-05-10modsys: Enable sys.exit() per port after all.Paul Sokolovsky
2014-05-10modsys, unix: Add sys.exit(), should be implemented by a port.Paul Sokolovsky
2014-05-10py: Disable frozenset by default, enable on unix.Paul Sokolovsky
Takes 416 text bytes on x86.
2014-05-10objset: Give up and implement frozenset.Paul Sokolovsky
Tired of patching CPython stdlib for it.
2014-05-10objtype: Don't treat inheritance from "object" as from native type.Paul Sokolovsky
"object" type in MicroPython currently doesn't implement any methods, and hopefully, we'll try to stay like that for as long as possible. Even if we have to add something eventually, look up from there might be handled in adhoc manner, as last resort (that's not compliant with Python3 MRO, but we're already non-compliant). Hence: 1) no need to spend type trying to lookup anything in object; 2) no need to allocate subobject when explicitly inheriting from object; 3) and having multiple bases inheriting from object is not a case of incompatible multiple inheritance.
2014-05-10py: Tidy up returning NULL which should be MP_OBJ_NOT_SUPPORTED.Damien George
2014-05-10py: Combine native emitters to 1 glue function; distinguish viper.Damien George
This patch simplifies the glue between native emitter and runtime, and handles viper code like inline assember: return values are converted to Python objects. Fixes issue #531.
2014-05-10py: Rename byte_code to bytecode everywhere.Damien George
bytecode is the more widely used. See issue #590.
2014-05-10py: Fix base "detection" for int('0<hexdigit>', 16).Paul Sokolovsky
2014-05-10bytes: Implement comparison and other binary operations.Paul Sokolovsky
Should support everything supported by strings.
2014-05-10runtime0.h: Group binary ops by fives.Paul Sokolovsky
So one has some chance to convert numeric op code into symbol.
2014-05-09windows: Add modtime implementationstijn
2014-05-08Add gc.enable, gc.disable; remove pyb.gc.Damien George
2014-05-09Merge pull request #568 from stinos/windows-msvc-portPaul Sokolovsky
Windows MS Visual C port
2014-05-08py, compiler: Add basic support for A=const(123).Damien George
You can now do: X = const(123) Y = const(456 + X) and the compiler will replace X and Y with their values. See discussion in issue #266 and issue #573.
2014-05-08Windows MSVC portstijn
Extend the windows port so it compiles with the toolchain from Visual Studio 2013
2014-05-07py: Fix stack access in thumb native emitter.Damien George
2014-05-07py: Fix emitcpy, to work with latest changes to PASS variables.Damien George
2014-05-07py: Improve native emitter; now supports more opcodes.Damien George
2014-05-07py, compiler: Improve passes; add an extra pass for native emitter.Damien George
2014-05-07py, compiler: Start adding support for compile-time constants.Damien George
Just a start, no working code yet. As per issue #573.
2014-05-07stream: Make non-blcoking stream support configurable.Paul Sokolovsky
Enable only on unix. To avoid unpleasant surprises with error codes.
2014-05-07stream: Use standard name of DEFAULT_BUFFER_SIZE.Paul Sokolovsky
2014-05-07stream: Add compliant handling of non-blocking readall().Paul Sokolovsky
2014-05-07stream: Add compliant handling of non-blocking read()/write().Paul Sokolovsky
In case of empty non-blocking read()/write(), both return None. read() cannot return 0, as that means EOF, so returns another value, and then write() just follows. This is still pretty unexpected, and typical "if not len:" check would treat this as EOF. Well, non-blocking files require special handling! This also kind of makes it depending on POSIX, but well, anything else should emulate POSIX anyway ;-).
2014-05-06py, parser: Add commented-out code to discard doc strings.Damien George
Doesn't help with RAM reduction because doc strings are interned as soon as they are encountered, which is too soon to do any optimisations on them.
2014-05-06Merge branch 'master' of https://github.com/micropython/micropythonDamien George
Conflicts: py/argcheck.c py/objenumerate.c py/runtime.h
2014-05-06py: Add keyword arg support to enumerate constructor.Damien George
Need to have a policy as to how far we go adding keyword support to built ins. It's nice to have, and gets better CPython compatibility, but hurts the micro nature of uPy. Addresses issue #577.