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.
11 years ago
Paul Sokolovsky
d944a66ead
Add string comparison tests.
Use computed string to exercise string interning code better.
11 years ago
Damien George
1143e5e72a
Merge pull request #120 from dhylands/make-build-quieter
Make build output quieter.
11 years ago
Damien George
93a9b5b64d
py: Proper framework for built-in 'type'.
11 years ago
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
11 years ago
Damien George
6c73ca1e75
py: add variable argument exception constructor function.
Addresses issue #104 .
11 years ago
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
11 years ago
Damien George
bb2ed8e431
Merge pull request #119 from dhylands/teensy-use-py.mk
Update teemsy/Makefile to use py.mk
11 years ago
Damien George
84a2c6fbda
Merge pull request #118 from dhylands/stm-use-OBJCOPY-SIZE-macros
Update stm/Makeile to use OBJCOPY and SIZE macros
11 years ago
Damien George
38a2da68c2
py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.
11 years ago
Dave Hylands
ee0013d24e
Update teemsy/Makefile to use py.mk
I also fixed main.c to compile with the new str lexer
11 years ago
Dave Hylands
c1db58799d
Update stm/Makeile to use OBJCOPY and SIZE macros
While updating the teensy Makfile, I noticed that the stm Makefile
was using calling arm-none-eabi-objcopy and size rather than
$(OBJCOPY) and $(SIZE), so I added these 2 for consistency.
11 years ago
Paul Sokolovsky
e0e79ae6d6
unix: Add basic implementation of io.FileIO object.
Note: only read/write/close methods are defined so far, and class
is not exposed (use open() factory function, as usual).
11 years ago
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).
11 years ago
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).
11 years ago
Damien George
ea9e441a75
Merge pull request #112 from iabdalkader/master
Use LSI OSC for RTC clock when LSE is not detected
11 years ago
Damien George
9193f89296
Move lexerstr to main py directory (everyone uses it).
11 years ago
Damien George
dc141db64d
Merge branch 'master' of github.com:dpgeorge/micropython
11 years ago
Damien George
e6b6af5154
Merge pull request #111 from dhylands/teensy
Updated teensy to use common code from stm directory.
11 years ago
Damien George
b97669ab94
py: Improve __build_class__.
11 years ago
mux
5df3d47ee0
Use LSI OSC for RTC clock when LSE is not detected
* Fix rtc_init to use LSI for RTC clock source when LSE is not detected.
11 years ago
Dave Hylands
9b7b947b01
Updated teensy to use common code from stm directory.
Updated mconfigport.h to enable GC
11 years ago
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 .
11 years ago
Damien George
dfc0bac086
py: Small big fix to type declarations.
11 years ago
John R. Lenton
baa665406f
Moved dict methods out to a mp_method_t.
11 years ago
John R. Lenton
689c16ae73
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
John R. Lenton
9c83ec0eda
Merge remote-tracking branch 'upstream/master' into dict_feats
11 years ago
John R. Lenton
27d4ca7693
forgot to add test for dict.update
11 years ago
John R. Lenton
88f3043e0a
added a first pass of dict.update
11 years ago
Damien George
e3096172c9
stm: Re-fix LED defines.
11 years ago
Damien George
1a9951d5aa
py: Fix up number operations and coercion.
11 years ago
John R. Lenton
be8fe5be2e
Added dict.setdefault
11 years ago
John R. Lenton
f77dce8a5d
Added dict.popitem
11 years ago
John R. Lenton
0fcbaa442f
implemented dict.pop
11 years ago
John R. Lenton
cd0887352d
Added dict.get.
11 years ago
John R. Lenton
d90b19eca5
Added dict.copy
11 years ago
John R. Lenton
7d21d516d2
make dict_len use the map's used count
11 years ago
John R. Lenton
4ce6ceadca
Added dict.clear.
Added 0 to the list of primes. Funky primes, these.
11 years ago
John R. Lenton
a41fe31322
Added dict iterator.
11 years ago
Paul Sokolovsky
24507aff7d
Typo fix in comment.
11 years ago
Paul Sokolovsky
af61a1a492
Use constructor to create small int (avoid exposing mp_obj_t internals to VM).
11 years ago
Dave Hylands
b6e9c7c697
Initial support for Teensy 3.1
11 years ago
mux
b59fa2da28
Fix LED pin enum
* Fix LED pin enum, first one should start at 1
* Fix LED initialization typo
11 years ago
Damien George
777575712b
Merge pull request #105 from chipaca/listsort
A more python-style list.sort. And keyword arguments.
11 years ago
Paul Sokolovsky
1e40840b3b
Add OSError, Python 3.3 generic I/O exception.
11 years ago
John R. Lenton
3391e19068
A bit of stylistic cleanup (chose the wrong side during conflict resolution).
11 years ago
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
11 years ago
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.
11 years ago
Damien George
fd04bb3bac
Add some example scripts for pyboard (some can run on PC).
11 years ago
Damien George
7b21c2d8f0
py: Fix allocation of unique code blocks.
11 years ago