Damien George
09a0c64bce
py: Improve __bool__ and __len__ dispatch; add slots for them.
11 years ago
Damien George
b25711ea8f
Merge pull request #238 from pfalcon/bool_len
Implement __bool__ and __len__ via unary_op virtual method for all types.
11 years ago
Paul Sokolovsky
c1d9bbc345
Implement __bool__ and __len__ via unary_op virtual method for all types.
__bool__() and __len__() are just the same as __neg__() or __invert__(),
and require efficient dispatching implementation (not requiring search/lookup).
type->unary_op() is just the right choice for this short of adding
standalone virtual method(s) to already big mp_obj_type_t structure.
11 years ago
Paul Sokolovsky
cdd2c62e07
realloc(): Log original memory ptr too.
To alloc complete memory alloc flow tracing.
11 years ago
Damien George
4a74d31e70
run-tests can handle segfault.
11 years ago
Damien George
14b929f1d9
Merge branch 'master' of github.com:msiemens/micropython into msiemens-master
11 years ago
Damien George
62ad189a65
py: Add compile option to enable/disable source line numbers.
11 years ago
Damien George
2d15c1216d
stm: Add optional memory debugging output.
11 years ago
Damien George
d0691ccaec
py: Simplify fastn in VM; reduce size of unique code struct.
We still have FAST_[0,1,2] byte codes, but they now just access the
fastn array (before they had special local variables). It's now
simpler, a bit faster, and uses a bit less stack space (on STM at least,
which is most important).
The only reason now to keep FAST_[0,1,2] byte codes is for compressed
byte code size.
11 years ago
Damien George
01fa4a9164
stm: Fix gccollect ram range.
11 years ago
Damien George
0347fbd2d5
Merge branch 'master' of github.com:iabdalkader/micropython
11 years ago
Damien George
08d075592f
py: Fix bug with LOAD_METHOD; fix int->machine_int_t for small int.
LOAD_METHOD bug was: emitbc did not correctly calculate the amount of
stack usage for a LOAD_METHOD operation.
small int bug was: int was being used to pass small ints, when it should
have been machine_int_t.
11 years ago
Damien George
1ba1facaaa
py: Msg in exception is no longer interned.
11 years ago
Damien George
4d5b28cd08
Add qstr_info() function and bindings for unix port.
11 years ago
mux
bfb01e9da6
Fix unused function warning in main
* Add SD card test to fix warning
11 years ago
mux
8592d85b36
Remove redundant include in file.c
* Remove include mpconfigport.h from file.c
11 years ago
mux
76a6335b6e
Move HEAP_END and RAM_END to linker script
* Issue #232
11 years ago
Damien George
217814cc63
stm: Increase timeout for RTC LSE startup; use backup regs.
11 years ago
Damien George
e4b6a079b3
py: Implement 'not' in compiler, and improve rt_is_true.
11 years ago
Damien George
b40892d266
Rename array test to array1 so it doesn't clash with array module.
On my machine, 'import array' in CPython tries to load the array test.
11 years ago
Damien George
8bf91f2a87
unix: Fix compile warnings for ffi module on 64-bit machine.
11 years ago
Damien George
4729a0ccea
Merge pull request #235 from pfalcon/modffi
unix: Initial FFI module implementation
11 years ago
Paul Sokolovsky
809eaa2679
Add FFI module example.
11 years ago
Paul Sokolovsky
60a9fac8d4
unix: Initial implementation of FFI module.
Foreign Function Interface module allows to load native dynamic libraries,
call functions and access variables in them. This makes possible to write
interface modules in pure Python.
This module provides thin wrapper around libffi. ctypes compatibility might
be possible to implement on top of this module (though ctypes allow to call
functions without prototypes, which is not supported by libffi (i.e.
implementation would be inefficient))).
11 years ago
Paul Sokolovsky
7f11c794a5
mp_obj_new_bytearray_by_ref(): Allow to create array by reference.
This is special feature for FFI.
11 years ago
Markus Siemens
242856cfbf
Fixed problems with nlx86.S on Linux
Fixed '#ifdef's so Linux would compile again and added
.scl and .type for Windows.
11 years ago
Markus Siemens
19ccc6bdc7
Added Windows port (see #233 )
11 years ago
Paul Sokolovsky
1801421f6d
bytearray: Print objects properly.
11 years ago
Paul Sokolovsky
0b7e29c025
Factor out quoted string print function for reuse (mp_str_print_quoted()).
11 years ago
Paul Sokolovsky
8e991e0680
Add basic array.array test.
11 years ago
Paul Sokolovsky
7e652af242
array: CPython prints empty arrays inconsistently (only typecode, no []).
11 years ago
Paul Sokolovsky
0dd0467a97
Don't pre-import array module.
11 years ago
Paul Sokolovsky
11973b48b5
array.array: Allow to create empty arrays.
11 years ago
Damien George
42647e64db
stm: Remove unneccesary include of mpconfigport (already in mpconfig).
11 years ago
Damien George
c674f02d5c
Merge pull request #231 from iabdalkader/master
Fix implicit double conversion warning
11 years ago
Damien George
c7aa9fcae5
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
4e8dc8c41b
py: Add unary op not for NoneType, bool, tuple, list, dict; fix for int.
11 years ago
mux
8d3b0a9f74
Add LCD check to stdout_print_strn
11 years ago
Paul Sokolovsky
9b00dad7bb
long int: Implement more operations.
11 years ago
mux
bd61a6cee8
Add missing LCD driver definitions for STM32F4DISC
* Add missing LCD definitions for STM32F4DISC target, current code
breaks build.
11 years ago
mux
00a4da93e8
Fix implicit double conversion warning
11 years ago
Paul Sokolovsky
ddf1aa9223
list.pop(): Don't allow ->alloc drop to zero, which causes unexpected behavior.
11 years ago
Paul Sokolovsky
14d28be344
gen.send(): Throw StopIteration. Also, explicitly shutdown finished gen.
Otherwise, some generator statements still may be spuriously executed on
subsequent calls to next()/send().
11 years ago
Damien George
addf60b2e6
Merge pull request #228 from pfalcon/gen-send
Implement send() method for generators.
11 years ago
Paul Sokolovsky
bf38e2a03a
Implement send() method for generators.
11 years ago
Damien George
56bb636014
Change -Og to -O0 in unix-cpy/Makefile; cast to small int in socket.c.
11 years ago
Damien George
554a75b689
Merge pull request #226 from pfalcon/make-debug
unix Makefile: -Og doesn't work (at least) with gcc 4.6 below.
11 years ago
Damien George
5bd56fbf13
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
75abee206d
stm: USB host mode working! Restructure stm library directories.
11 years ago
Paul Sokolovsky
4795c58f3c
sock-server.py: Use SO_REUSEADDR to avoid errors on quick restart.
11 years ago