Damien George
c9f8f653ad
py: Add support for float/double arrays in array module.
...
Addresses issue #981 .
2014-11-21 18:16:25 +00:00
blmorris
9d1ca65b59
Set PYTHONIOENCODING='utf-8' so that unicode tests can pass on CPython on
...
systems where another encoding is set in the locale
2014-11-19 10:44:31 -05:00
Damien George
5694cc5490
py: Make stream seek correctly check for ioctl fn; add seek for textio.
2014-11-16 23:56:37 +00:00
Paul Sokolovsky
c7d5500142
tests: Add test for file.seek().
2014-11-17 00:16:14 +02:00
Damien George
224fee0e10
stmhal: Fix HAL error raising; make test for it.
...
Addresses issue #968 .
2014-11-15 20:39:44 +00:00
Damien George
4df85e49d4
tests: Add test for hash of user defined class.
2014-11-15 18:30:01 +00:00
Damien George
a65c03c6c0
py: Allow +, in, and compare ops between bytes and bytearray/array.
...
Eg b"123" + bytearray(2) now works. This patch actually decreases code
size while adding functionality: 32-bit unix down by 128 bytes, stmhal
down by 84 bytes.
2014-11-05 16:30:34 +00:00
Damien George
0344fa1ddf
py: Fix builtin callable so it checks user-defined instances correctly.
...
Addresses issue #953 .
2014-11-03 16:09:39 +00:00
Paul Sokolovsky
039887a0ac
py: Fix bug with right-shifting small ints by large amounts.
...
Undefined behavior in C, needs explicit check.
2014-11-02 02:41:30 +02:00
Damien George
c7da7838ba
tests: Add heapalloc.py.exp, since CPython can't generate it.
2014-10-31 22:09:40 +00:00
Damien George
109c1de015
py: Make gc.enable/disable just control auto-GC; alloc is still allowed.
...
gc.enable/disable are now the same as CPython: they just control whether
automatic garbage collection is enabled or not. If disabled, you can
still allocate heap memory, and initiate a manual collection.
2014-10-31 21:30:46 +00:00
Damien George
1559a97810
py: Add builtin round function.
...
Addresses issue #934 .
2014-10-31 11:28:50 +00:00
Damien George
efc49c5591
stmhal: Improve CAN print function.
2014-10-30 23:16:05 +00:00
Henrik Sölver
6a15ac80dc
tests: Added and adapted CAN tests for extended messages
2014-10-30 23:16:01 +00:00
Paul Sokolovsky
e62a0fe367
objstr: Allow to convert any buffer proto object to str.
...
Original motivation is to support converting bytearrays, but easier to just
support buffer protocol at all.
2014-10-31 00:03:53 +02:00
Paul Sokolovsky
66d08eb4fe
moductypes: Add test for accessing UINT8 array.
2014-10-30 03:50:37 +02:00
Paul Sokolovsky
2559e13957
moductypes: Make sure we can apply .sizeof() to all aggregate types.
...
Before, sizeof() could be applied to a structure field only if that field
was itself a structure. Now it can be applied to PTR and ARRAY fields too.
It's not possible to apply it to scalar fields though, because as soon as
scalar field (int or float) is dereferenced, its value is converted into
Python int/float value, and all original type info is lost. Moreover, we
allow sizeof of type definitions too, and there int is used to represent
(scalar) types. So, we have ambiguity what int may be - either dereferenced
scalar structure field, or encoded scalar type. So, rather throw an error
if user tries to apply sizeof() to int.
2014-10-30 03:50:23 +02:00
Damien George
b2f19b8d34
tests: Get builtin_compile to skin properly on pyboard.
2014-10-26 15:38:28 +00:00
Damien George
480a7ce58f
stmhal: Change SPI phase spec to 0,1 to match standard conventions.
...
Was 1 or 2, now 0 or 1 (respectively). 0 means sample MISO on first
edge, 1 means sample on second edge.
Addresses issue #936 .
2014-10-26 13:54:31 +00:00
Damien George
de3c806965
py: Fix memoryview referencing so it retains ptr to original buffer.
...
This way, if original parent object is GC'd, the memoryview still points
to the underlying buffer data so that buffer is not GC'd.
2014-10-26 13:20:50 +00:00
Damien George
627852019b
tests: Add test for compile builtin.
2014-10-25 22:07:25 +01:00
Paul Sokolovsky
e2f8d98525
stream: Add optional 2nd "length" arg to .readinto() - extension to CPython.
...
While extension to file.readinto() definition of CPython, the additional arg
is similar to what in CPython available in socket.recv_into().
2014-10-23 21:43:59 +03:00
Damien George
dd4f4530ab
py: Add builtin memoryview object (mostly using array code).
2014-10-23 13:34:35 +01:00
Damien George
f5d69794a8
extmod: Add uheapq module.
2014-10-22 23:20:15 +01:00
Damien George
e72be1b999
py: Fix smallint modulo with negative arguments.
...
Addresses issue #927 .
2014-10-22 23:05:50 +01:00