Damien George
ad97f2a49e
Merge pull request #136 from pfalcon/for-range-downto
...
compile_for_stmt_optimised_range(): Properly handle negative & unknown s...
2014-01-10 15:21:50 -08:00
Damien George
e9b4b7ac75
Merge pull request #135 from pfalcon/simple-raise
...
Crude attempt to implement RAISE_VARARGS (with args=1 so far only).
2014-01-10 15:20:08 -08:00
Damien George
46c9e97132
Merge pull request #134 from pfalcon/list-mul
...
list: Implement list multiplication.
2014-01-10 15:17:17 -08:00
Damien George
745ce4c2ad
Merge pull request #131 from chipaca/dict_fromkeys
...
Added dict.fromkeys.
2014-01-10 15:11:56 -08:00
Paul Sokolovsky
899c69f94c
compile_for_stmt_optimised_range(): Properly handle negative & unknown steps.
...
If step is not constant, in first approximation, we can't apply optimization,
(well, we could, but need a special case for this).
2014-01-11 01:00:21 +02:00
Paul Sokolovsky
5388a3c29a
Crude attempt to implement RAISE_VARARGS (with args=1 so far only).
2014-01-11 00:55:08 +02:00
Paul Sokolovsky
074d3b5f86
list: Implement list multiplication.
2014-01-11 00:49:19 +02:00
Paul Sokolovsky
bab5cfb34f
Unsupported operand types for binary operator: dump both args' types.
2014-01-11 00:14:48 +02:00
Paul Sokolovsky
d6f27fe317
mp_obj_equal(): Print which types' equality not implemented before assert().
2014-01-11 00:14:33 +02:00
Paul Sokolovsky
e06edce786
mp_repl_is_compound_stmt(): Thinko fix s/true/try/.
2014-01-11 00:12:06 +02:00
Paul Sokolovsky
4b919d0135
Dump few more bytecodes (based on attempt to run real-world code).
2014-01-11 00:10:49 +02:00
John R. Lenton
4bee76ebca
Added dict.fromkeys. Are we done with dict and #99 yet? I do think we are.
2014-01-10 11:25:03 +00:00
John R. Lenton
9ec3a87189
dict views now, refactoring later.
2014-01-10 01:00:20 +00:00
Damien George
2d45429122
Use memcpy instead of strncpy; add usart.status to stm.
2014-01-09 22:04:45 +00:00
Damien George
be842973b0
Merge pull request #123 from xbe/master
...
Implement str.strip
2014-01-09 13:55:55 -08:00
Damien George
004cdcebfe
py: Implement base class lookup, issubclass, isinstance.
2014-01-09 21:43:51 +00:00
Damien George
062478e66d
Improved type/class/instance code; mp_obj_type_t now has load_attr, store_attr.
...
Creating of classes (types) and instances is much more like CPython now.
You can use "type('name', (), {...})" to create classes.
2014-01-09 20:57:50 +00:00
xbe
7b0f39f318
Implement str.strip
2014-01-08 14:23:45 -08:00
Damien George
1143e5e72a
Merge pull request #120 from dhylands/make-build-quieter
...
Make build output quieter.
2014-01-08 10:52:32 -08:00
Damien George
93a9b5b64d
py: Proper framework for built-in 'type'.
2014-01-08 18:48:12 +00:00
Dave Hylands
4646801181
Make build output quieter.
...
Use make V=1e make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
This should fix issue #117
2014-01-08 10:30:06 -08:00
Damien George
6c73ca1e75
py: add variable argument exception constructor function.
...
Addresses issue #104 .
2014-01-08 18:11:23 +00:00
Damien George
199b9e04eb
Merge pull request #114 from pfalcon/streams-bootstrap
...
Define buffer and stream protocols, and other starting bits of io.* framework, with io.FileIO-like implementation for Unix
2014-01-08 09:50:15 -08:00
Damien George
38a2da68c2
py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.
2014-01-08 17:33:12 +00:00
Paul Sokolovsky
e98cf40c34
Add generic implementations of Python read()/write methods for streams.
...
These can be used for any object which implements stream protocol
(mp_stream_p_t).
2014-01-08 17:38:38 +02:00
Paul Sokolovsky
5b15daf6d1
Add support for stream and buffer protocols.
...
Stream protocol is abstraction of serial I/O. Buffer protocol is
abstraction of random-access I/O. These protocols are defined down
to C level, to allow generic, while still efficient algorithms
to be coded in C (like, buffered transfer between 2 stream objects,
saving/loading of buffer object to/from stream, etc). (Note that CPython
define buffer protocol on C level, but apparently not stream protocol).
2014-01-08 17:38:38 +02:00
Damien George
9193f89296
Move lexerstr to main py directory (everyone uses it).
2014-01-08 15:28:26 +00:00
Damien George
b97669ab94
py: Improve __build_class__.
2014-01-08 11:47:55 +00:00
Damien George
6d6bc9efc1
Merge pull request #108 from chipaca/dict_feats
...
Dictionary features that don't involve views or classmethods. First part of issue #99 .
2014-01-07 15:42:16 -08:00
Damien George
dfc0bac086
py: Small big fix to type declarations.
2014-01-07 23:18:54 +00:00
John R. Lenton
baa665406f
Moved dict methods out to a mp_method_t.
2014-01-07 23:18:25 +00:00
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
2014-01-07 23:06:46 +00:00
John R. Lenton
88f3043e0a
added a first pass of dict.update
2014-01-07 22:51:08 +00:00
Damien George
1a9951d5aa
py: Fix up number operations and coercion.
2014-01-07 22:51:08 +00:00
John R. Lenton
be8fe5be2e
Added dict.setdefault
2014-01-07 22:51:08 +00:00
John R. Lenton
f77dce8a5d
Added dict.popitem
2014-01-07 22:51:08 +00:00
John R. Lenton
0fcbaa442f
implemented dict.pop
2014-01-07 22:51:08 +00:00
John R. Lenton
cd0887352d
Added dict.get.
2014-01-07 22:51:08 +00:00
John R. Lenton
d90b19eca5
Added dict.copy
2014-01-07 22:51:08 +00:00
John R. Lenton
7d21d516d2
make dict_len use the map's used count
2014-01-07 22:51:08 +00:00
John R. Lenton
4ce6ceadca
Added dict.clear.
...
Added 0 to the list of primes. Funky primes, these.
2014-01-07 22:51:08 +00:00
John R. Lenton
a41fe31322
Added dict iterator.
2014-01-07 22:51:08 +00:00
Paul Sokolovsky
24507aff7d
Typo fix in comment.
2014-01-07 22:51:08 +00:00
Paul Sokolovsky
af61a1a492
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
2014-01-07 22:51:08 +00:00
Damien George
777575712b
Merge pull request #105 from chipaca/listsort
...
A more python-style list.sort. And keyword arguments.
2014-01-07 14:49:22 -08:00
Paul Sokolovsky
1e40840b3b
Add OSError, Python 3.3 generic I/O exception.
2014-01-07 20:16:54 +02:00
John R. Lenton
3391e19068
A bit of stylistic cleanup (chose the wrong side during conflict resolution).
2014-01-07 18:06:34 +00:00
John R. Lenton
270112f731
Merge remote-tracking branch 'upstream/master' into listsort. Lots of conflict fun.
...
Conflicts:
py/obj.h
py/objbool.c
py/objboundmeth.c
py/objcell.c
py/objclass.c
py/objclosure.c
py/objcomplex.c
py/objdict.c
py/objexcept.c
py/objfun.c
py/objgenerator.c
py/objinstance.c
py/objmodule.c
py/objrange.c
py/objset.c
py/objslice.c
2014-01-07 18:01:08 +00:00
John R. Lenton
c06763a020
This implements a better (more python-conformant) list.sort.
...
It's not really about that, though; it's about me figuring out a sane
way forward for keyword-argument functions (and function
metadata). But it's useful as is, and shouldn't break any existing
code, so here you have it; I'm going to park it in my mind for a bit
while sorting out the rest of the dict branch.
2014-01-07 17:29:16 +00:00
Damien George
7b21c2d8f0
py: Fix allocation of unique code blocks.
2014-01-07 16:54:58 +00:00