Damien George
1d6fc94c16
Implement framework for class-defined built-in operators.
Now working for class-defined methods: __getitem__, __setitem__,
__add__, __sub__. Easy to add others.
11 years ago
Damien George
0c4e909e76
Merge pull request #191 from pfalcon/store-item
Add store_item() virtual method to type to implement container[index] = val
11 years ago
Damien George
632cf5710c
Merge branch 'master' of github.com:dpgeorge/micropython
11 years ago
Paul Sokolovsky
d26b379eec
int: Add value accessors: mp_obj_int_get() & mp_obj_int_get_checked().
mp_obj_int_get() can be used when just full resolution of C machine_int_t
is required (returns truncated value of long int). mp_obj_int_get_checked()
will throw exception if Python int value not representable in machine_int_t.
11 years ago
Damien George
20006dbba9
Make VM stack grow upwards, and so no reversed args arrays.
Change state layout in VM so the stack starts at state[0] and grows
upwards. Locals are at the top end of the state and number downwards.
This cleans up a lot of the interface connecting the VM to C: now all
functions that take an array of Micro Python objects are in order (ie no
longer in reverse).
Also clean up C API with keyword arguments (call_n and call_n_kw
replaced with single call method that takes keyword arguments). And now
make_new takes keyword arguments.
emitnative.c has not yet been changed to comply with the new order of
stack layout.
11 years ago
Paul Sokolovsky
6d8edf6acf
Add store_item() virtual method to type to implement container[index] = val.
11 years ago
Paul Sokolovsky
166bb40fb2
Add OverflowError and use it for small int overflow instead of assert.
11 years ago
Damien George
8655065f8c
Merge pull request #184 from pfalcon/int-longlong
Python long int implementation using C long long
11 years ago
Paul Sokolovsky
a9f5abd48c
Implement LOAD_CONST_INT (by dispatching to int object implementation).
11 years ago
Paul Sokolovsky
966879cf59
Add long int implementation using C long long type, enable for unix port.
11 years ago
Damien George
5a877503d9
Merge branch 'master' of github.com:dpgeorge/micropython
11 years ago
Damien George
8161a10de1
stm: Add stm import support.
11 years ago
Paul Sokolovsky
10744dd816
Add empty (false) value testing for strings, tuples, lists, dicts.
11 years ago
Damien George
eea2eb1bb7
Merge pull request #180 from pfalcon/examples-improve
Improve compatibility of examples with CPython (+ interp compatibility too)
11 years ago
Paul Sokolovsky
dcac88095b
Add empty "micropython" module to allow more seamless CPython portability.
Implicit "micropython" module contains (at least) codegeneration decorators.
Make it explicit, so an app could have "import micropython". On MicroPython,
that will be no-op. On CPython, that will give a chance to have a module
with placeholder decorators.
11 years ago
Paul Sokolovsky
c8742a06ca
Add dummy micropython module to enable mandel.py run with CPython.
11 years ago
Paul Sokolovsky
d0db3d3e45
conwaylife.py: Give people chance to enjoy the show.
Delay between frames; run more generations.
11 years ago
Paul Sokolovsky
2aefde06b7
CPython pyb.py placeholder: Implement delay().
11 years ago
Paul Sokolovsky
a671f891dd
Make file.read() and file.read(-1) call out to file.readall().
Per Python3 io module semantics.
11 years ago
Paul Sokolovsky
323c09e881
Do not assume that vstr buf is the same after it was extended.
11 years ago
Paul Sokolovsky
f2b796e7c7
str.format: Don't assume that '}' immediately follows '{', skip insides.
That at least makes stuff like "{:x}".format(1) to produce not completely
broken output.
11 years ago
Damien George
b99d9ea258
Add errno=0 before call.
11 years ago
Damien George
613eb25545
stm: Fix print methods with new kind argument.
11 years ago
Damien George
5573f9f150
Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2int
Conflicts:
py/objint.c
unix-cpy/Makefile
unix/Makefile
11 years ago
Damien George
4899ff9470
Merge branch 'str-repr' of github.com:pfalcon/micropython into pfalcon-str-repr
Conflicts:
tests/basics/tests/exception1.py
11 years ago
Damien George
7a9d0c4540
Merge branch 'builtins' of github.com:chipaca/micropython into chipaca-builtins
Added some checks for number of arguments.
Conflicts:
py/mpqstrraw.h
11 years ago
Damien George
11507f4074
Merge branch 'master' of github.com:dpgeorge/micropython
11 years ago
Damien George
d02c6d8962
Implement eval.
11 years ago
Paul Sokolovsky
9953ca432b
Add unbuffered readline() implementation for Raw I/O files.
11 years ago
Damien George
e2fb2baaa4
Implement repr.
11 years ago
Damien George
9528cd66d7
Convert parse errors to exceptions.
Parser no longer prints an error, but instead returns an exception ID
and message.
11 years ago
xyb
3e4ed25138
add more tests and remove debug code
11 years ago
xyb
3270fb4be6
int() test passed
11 years ago
John R. Lenton
fca456bc3c
added filter()
11 years ago
John R. Lenton
39b174e00a
Added map
11 years ago
Paul Sokolovsky
36c4499d36
Implement str() and repr() builtin functions.
11 years ago
Paul Sokolovsky
76d982ef34
type->print(): Distinguish str() and repr() variety by passing extra param.
11 years ago
John R. Lenton
ff8007c7d6
Merge remote-tracking branch 'upstream/master' into builtins
11 years ago
Damien George
24224d7c72
Make GitHub logo/image a JPEG so it's smaller.
11 years ago
John R. Lenton
9daa78943e
added enumerate()
11 years ago
Damien George
c6920d31e2
Merge pull request #170 from chipaca/master
made DEBUG control CFLAGS in Makefiles other than stm as well.
11 years ago
Damien George
0367ad6214
stm: Include libgcc for __aeabi_d2f and __aeabi_f2d functions.
Thanks to Dave Hylands for this.
11 years ago
Damien George
36b35c041b
Merge pull request #163 from Metallicow/README-branch
Add combined image to GitHub front page README.md
11 years ago
Damien George
a04a33fee7
Merge pull request #175 from iabdalkader/master
Add missing ADC driver
11 years ago
Damien George
11cc694aa0
Merge pull request #173 from pfalcon/file-readall
Generic implementation if stream readall() method, immediately reused in unix io.FileIO implementation
11 years ago
Damien George
39eab8de96
Merge pull request #161 from pfalcon/exc-more-pythonic
Move towards Python-compliant interface of exceptions
11 years ago
Damien George
66a5bf681d
Merge pull request #142 from chipaca/containment
Implemented support for `in` and `not in` operators.
11 years ago
Damien George
0f59203e37
Tidy up.
11 years ago
Damien George
6c2401e935
Merge pull request #165 from chipaca/builtins
added zip()
11 years ago
Paul Sokolovsky
8bc96471f0
Implement "is" and "is not" operators.
So far, don't work for strings as expected.
11 years ago