Paul Sokolovsky
147c80bf7c
modstruct: Use MP_OBJ_FUN_ARGS_MAX instead of -1.
11 years ago
Paul Sokolovsky
5ebd5f0f19
objstr: Slice indexing: support bytes properly.
11 years ago
Paul Sokolovsky
bfb8819c0c
objstr: Make .split() support bytes.
11 years ago
Paul Sokolovsky
5e5d69b35e
objstr: Make .join() support bytes.
11 years ago
Paul Sokolovsky
7e7940c39d
py: Fix __len__ special method result handling.
Having both MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL is arguably confusing.
11 years ago
Paul Sokolovsky
c48d6f7add
py: Don't expect that type->getiter() always returns iterator, check for NULL.
This is better than forcing each getiter() implementation to raise exception.
11 years ago
Paul Sokolovsky
0f570cfccf
showbc: Decode MAP_ADD.
11 years ago
Paul Sokolovsky
ff30666c69
py: Add basic implementation of hasattr() function.
11 years ago
Damien George
a0863158f5
Merge pull request #605 from stinos/travis-mingw
travis: Add cross-compilation of mingw port
11 years ago
Damien George
96b62855b5
Merge pull request #604 from stinos/windows-enablefeat
windows: Enable frozen set and sys.exit
11 years ago
Damien George
ee7a880d6e
py: Use mp_arg_check_num in more places.
Updated functions now do proper checking that n_kw==0, and are simpler
because they don't have to explicitly raise an exception. Down side is
that the error messages no longer include the function name, but that's
acceptable.
Saves order 300 text bytes on x64 and ARM.
11 years ago
stijn
5f9ebd36cd
travis: Add cross-compilation of mingw port
11 years ago
Damien George
1d34e32431
py: frozenset() creates an empty frozenset.
11 years ago
stijn
b9d8091d0e
windows: Enable frozen set and sys.exit
11 years ago
Damien George
2323ef9182
py: Rename globally-accessible tuple functions, prefix with mp_obj_.
Likely there are other functions that should be renamed, but this is a
start.
11 years ago
Damien George
c59af52e84
py: Rename some unichar functions for consistency.
11 years ago
Damien George
89755ae67f
py: Rename MICROPY_SYS_EXIT to MICROPY_MOD_SYS_EXIT.
For consistency with MICROPY_MOD_SYS_STDFILES, etc.
11 years ago
Damien George
f92a0d4d16
stmhal: Enable frozenset. Takes 292 text bytes in ROM.
11 years ago
Damien George
bd651d1a67
Merge pull request #597 from stinos/mingw-compilation
mingw: Fix compilation issues
11 years ago
Damien George
c3dcb590b8
Merge pull request #603 from stinos/windows-tests-newline
tests: Fix handling of newlines from expected output files on windows
11 years ago
Damien George
18ceb7055b
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
a7a1a38df4
stmhal: Update CC3000 driver to newer version.
Still not working properly.
11 years ago
Paul Sokolovsky
eea0118654
py: Give up and make mp_obj_str_get_data() deal with bytes too.
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.
11 years ago
stijn
a4dbc73e8a
tests: Fix handling of newlines from expected output files
11 years ago
Paul Sokolovsky
b2d4fc06fc
objstr: Make *strip() accept bytes.
11 years ago
Paul Sokolovsky
ce6c10172b
tests: Really fix import.
11 years ago
Paul Sokolovsky
b4acd028b6
tests: Fix import.
11 years ago
Paul Sokolovsky
ea9708092e
objtuple: Go out of the way to support comparison of subclasses.
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.
11 years ago
Paul Sokolovsky
9511f60f01
py: Don't try to "bind" types store as attributes of objects.
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?
11 years ago
Paul Sokolovsky
69f3eb2c96
objstr: Make .[r]partition() work with bytes.
11 years ago
Paul Sokolovsky
285683d203
objboundmeth: If detailed reporting enabled, print object content.
Similar to closure and cell.
11 years ago
Paul Sokolovsky
7aca1cae34
py: Start making good use of mp_const_obj_t.
11 years ago
Damien George
50073ed5d6
stmhal/cc3k: Remove spaces and tabs at end of lines.
11 years ago
Paul Sokolovsky
3f8d34ca83
objlist: Support list slice deletion.
11 years ago
Paul Sokolovsky
94d8246272
objlist: Implement non-growing slice assignment.
Slice value to assign can be only a list so far too.
11 years ago
Paul Sokolovsky
d915a52eb6
py: Fix prefix on few sequence helpers, was incorrectly "mp_".
11 years ago
Paul Sokolovsky
aa4d19a05c
objtype: Comments for duplicating code in runtime.c.
11 years ago
Paul Sokolovsky
1a7403bb74
objtype: Implement ->getiter() method for instances.
Includes support for native bases.
11 years ago
Paul Sokolovsky
0bc15941c2
py: Make mp_obj_print() handle null object w/o segfault if debug build.
Happens regularly when used for debugging.
11 years ago
Paul Sokolovsky
7067d69bcc
objnamedtuple: Support iteration.
11 years ago
Damien George
3793830ed9
tools: Move gendoc.py to tools, and make it a little more generic.
11 years ago
Damien George
09bbe7215a
stmhal: Fix USB CDC not flushing packets when an exact multiple of 64.
Need to send a zero-sized packet after sending an exact multiple of 64
bytes (not just after sending 64 bytes exactly).
Addresses issue #494 , part 2.
11 years ago
Damien George
0fb80c303a
py: Compress a little the bytecode emitter structure.
11 years ago
Damien George
9597771fe4
py, emitters: Fix dummy_data size for bytecode and thumb.
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 .
11 years ago
Damien George
7db57bf6b2
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Paul Sokolovsky
6913521911
objstr: Implement .lower() and .upper().
11 years ago
Damien George
b0edec61ac
stmhal: Improve handling of out-of-memory in REPL.
Addresses issue #558 , but it's likely that other out-of-memory errors
could crash the pyboard. Reason is that qstrs use m_new and can raise
an exception within the parser.
11 years ago
Damien George
e1199ecf10
py, lexer: Add allocation policy config; return NULL if can't allocate.
11 years ago
Damien George
1b82e9af5c
py: Improve handling of memory error in parser.
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 .
11 years ago
Paul Sokolovsky
ad6178bb08
builtinimport: Fix broken namespace imports due to dup vstr_cut_tail_bytes().
11 years ago