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
Damien George
e7a478204a
py: Remove unused and unneeded SystemError exception.
...
It's purpose is for internal errors that are not catastrophic (ie not as
bad as RuntimeError). Since we don't use it, we don't need it.
2014-10-22 19:42:55 +01:00
Damien George
481d714bd5
stmhal: Overhaul UART class to use read/write, and improve it.
...
UART object now uses a stream-like interface: read, readall, readline,
readinto, readchar, write, writechar.
Timeouts are configured when the UART object is initialised, using
timeout and timeout_char keyword args.
The object includes optional read buffering, using interrupts. You can set
the buffer size dynamically using read_buf_len keyword arg. A size of 0
disables buffering.
2014-10-21 22:15:20 +01:00
stijn
a3efe04dce
Use mode/encoding kwargs in io and unicode tests
...
mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8
2014-10-21 22:10:38 +03:00
Damien George
21ca2d76a2
py: Partially fix viper multi-comparison; add test for it.
2014-10-19 19:00:51 +01:00
Paul Sokolovsky
1a55b6a787
unix, stmhal: Implement file.readinto() method.
...
Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
2014-10-18 22:44:07 +03:00
Paul Sokolovsky
297d8469b8
modure: Update to re1.5 v0.6.1, fixed and extended character class support.
2014-10-17 22:25:18 +03:00
Damien George
391db8669b
py: Add more compiler optimisations for constant if/while conditions.
2014-10-17 17:57:33 +00:00
Damien George
9870fdd4b0
tests: Add test for nested while with exc and break.
2014-10-17 17:28:25 +00:00
Paul Sokolovsky
067ae1269d
objclosure: Fix printing of generator closures.
...
The code previously assumed that only functions can be closed over.
2014-10-16 00:14:01 +03:00
Paul Sokolovsky
95908b0f50
modure: Update to re1.5 v0.6, support for char sets/classes ([a-c]).
2014-10-15 04:44:07 +03:00
Damien George
29f5682621
Merge pull request #904 from pfalcon/moduzlib
...
Module "uzlib" - based on similarly named library
2014-10-12 23:25:24 +01:00
Paul Sokolovsky
34162872b1
moduzlib: Integrate into the system.
2014-10-13 00:07:44 +03:00
Damien George
91cfd414c0
py: Implement native load for viper.
...
Viper can now do: ptr8(buf)[0], which loads a byte from a buffer using
machine instructions.
2014-10-12 16:59:29 +01:00
Damien George
1ef2348df0
py: Implement and,or,xor native ops for viper.
2014-10-12 14:21:06 +01:00
Paul Sokolovsky
f7bcce0552
modure: Basic tests.
2014-10-11 14:36:33 +03:00
Paul Sokolovsky
5dc8f9b28a
tests: Skip ffi_float.py if module ffi is not available.
2014-10-06 22:37:40 +03:00
Paul Sokolovsky
9aeec0e3a3
tests: Add missing "import sys".
2014-10-06 22:30:46 +03:00
Damien George
f53c343363
tests: Force skip of LE test on non-LE arch; improve run-tests-exp.sh.
2014-10-06 17:35:46 +00:00
Damien George
9c6f7378f7
tests: Make run-tests-exp.sh skip tests that fail due to invalid decorator.
...
Should address issue #856 .
2014-10-06 17:06:49 +00:00
Damien George
5a04e2cca8
tests: Add check for micropython.native and then skip relevant tests.
...
If micropython.native decorator doesn't compile, then we skill all
native/viper tests.
This patch also re-enables the ujson_loads test on NT.
Addresses issue #861 , and partially addresses issue #856 .
2014-10-05 22:27:12 +01:00
Damien George
a91ac2011f
py: Make compiler return a proper exception on SyntaxError.
2014-10-05 19:01:34 +01:00
Damien George
c3ab90da46
tests: Make printing of floats hopefully more portable.
2014-10-05 17:50:02 +01:00
stijn
dc1ea1156a
Exclude some tests which always fail on windows
2014-10-05 09:32:26 +02:00
Damien George
e535a61983
tests: Add simple CAN test.
2014-10-02 17:32:02 +01:00
blmorris
3b064370f8
Enable device keyword option when running pyboard.py --tests and run-tests --pyboard
2014-10-01 23:31:52 +01:00
Damien George
8b03d944e2
py: Remove IOError since it's deprecated; use OSError instead.
...
In CPython IOError (and EnvironmentError) is deprecated and aliased to
OSError. All modules that used to raise IOError now raise OSError (or a
derived exception).
In Micro Python we never used IOError (except 1 place, incorrectly) and
so don't need to keep it.
See http://legacy.python.org/dev/peps/pep-3151/ for background.
2014-09-30 13:59:30 +00:00
Damien George
dfef4249eb
py: Fix viper store on x86; add tests for viper ptr16.
2014-09-29 21:41:41 +00:00
Damien George
e9dac3b4d0
py: Add casting to viper; add native mem stores to viper.
...
Viper can now do the following:
def store(p:ptr8, c:int):
p[0] = c
This does a store of c to the memory pointed to by p using a machine
instructions inline in the code.
2014-09-29 22:10:41 +01:00
Damien George
44c96b2314
tests: Add tests for viper binary operations.
2014-09-29 19:42:06 +01:00
Damien George
6f81348fa2
py: Allow viper to use ints as direct conditionals in jumps.
...
Allows things like: if 1: ...
2014-09-29 19:42:06 +01:00
Damien George
cde0ca21bf
py: Simplify JSON str printing (while still conforming to JSON spec).
...
The JSON specs are relatively flexible and allow us to use one function
to print strings, be they ascii, bytes or utf-8 encoded.
2014-09-25 17:35:56 +01:00
blmorris
4f449120e1
Change allows tests/unix/ffi_float.py to pass on OSX
2014-09-25 16:31:30 +01:00
Damien George
2234c3f23d
tests: Add test for exception matching of a tuple of exceptions.
2014-09-25 15:49:26 +01:00
Damien George
d6230f62c7
py: Make native emitter handle multi-compare and not/is not/not in ops.
2014-09-23 14:15:45 +00:00
Damien George
96e20c600f
tests: Fix uctypes tests to run on 64bit arch; enable more native tests.
2014-09-23 14:15:45 +00:00
Damien George
2c180f7ccc
extmod, ujson: Add test and comment for loads.
2014-09-21 23:43:03 +01:00
Damien George
612045f53f
py: Add native json printing using existing print framework.
...
Also add start of ujson module with dumps implemented. Enabled in unix
and stmhal ports. Test passes on both.
2014-09-17 22:56:34 +01:00
Damien George
83695596ed
py: Fix build error when float disabled; add test for divmod.
2014-09-13 19:58:18 +01:00
Damien George
8594ce2280
py: Implement divmod, % and proper // for floating point.
...
Tested and working on unix and pyboard.
2014-09-13 18:43:09 +01:00
Damien George
c7a79284bb
tests: Enable misc tests on pyboard; output 4 sig figs in rge_sm.
2014-09-06 18:38:55 +01:00
Damien George
17598d49e1
unix: Don't use -Wno-error=cpp or #warning; fix strict alias warning.
...
For the sake of older versions of gcc (and other compilers), don't use
the #warning CPP directive, nor the -Wno-error=cpp option.
Also, fix a strict alias warning in modffi.c for older compilers, and
add a test for ffi module.
Addresses issue #847 .
2014-09-06 17:46:52 +01:00
Damien George
9a21d2e070
py: Make mpz able to use 16 bits per digit; and 32 on 64-bit arch.
...
Previously, mpz was restricted to using at most 15 bits in each digit,
where a digit was a uint16_t.
With this patch, mpz can use all 16 bits in the uint16_t (improvement
to mpn_div was required). This gives small inprovements in speed and
RAM usage. It also yields savings in ROM code size because all of the
digit masking operations become no-ops.
Also, mpz can now use a uint32_t as the digit type, and hence use 32
bits per digit. This will give decent improvements in mpz speed on
64-bit machines.
Test for big integer division added.
2014-09-06 17:15:34 +01:00
Damien George
02d95d7ce9
py: Fix 2 bugs in native emitter: jump_or_pop and stack settling.
...
Addresses issue #838 .
2014-08-29 20:05:32 +01:00
Damien George
15d2fe8da4
tests: Add option to run-tests to enable native emitter.
2014-08-29 19:47:10 +01:00
Dave Hylands
b7f7c655ed
Make int(b'123') work properly.
2014-08-26 19:15:04 -07:00
Damien George
779794a680
py: Add dispatch for user defined ==, >, <=, >=.
...
Addresses issue #827 .
2014-08-26 09:31:26 +01:00
Damien George
fa1a9bc9fd
tests: Add test for pyb.disable_irq and pyb.enable_irq.
2014-08-25 18:44:10 +01:00
Damien George
7310fd469a
py: Consolidate min/max functions into one, and add key= argument.
...
Addresses issue #811 .
2014-08-24 19:14:09 +01:00
Damien George
8ba832456e
stmhal, modtime: Small changes, reduced code size by around 80 bytes.
...
Also added test for modtime.
2014-08-24 17:40:24 +01:00
Damien George
3c658a4e75
py: Fix bug where GC collected native/viper/asm function data.
...
Because (for Thumb) a function pointer has the LSB set, pointers to
dynamic functions in RAM (eg native, viper or asm functions) were not
being traced by the GC. This patch is a comprehensive fix for this.
Addresses issue #820 .
2014-08-24 16:28:17 +01:00
Damien George
86de21b810
py: Viper can call functions with native types, and raise exceptions.
2014-08-16 22:06:11 +01:00
Damien George
d779b9642f
tests: Wait for just over 1 sec when testing RTC.
...
Waiting for 1000ms between seconds of RTC is sometimes too quick.
Waiting for 1001ms is enough for the RTC to pass 1 second.
2014-08-16 13:39:14 +01:00
Damien George
e6c0dff967
py: Viper can now store to global.
2014-08-15 23:47:59 +01:00
Damien George
a5190a7dac
py: Fix typing of viper locals; allow default types in annotation.
2014-08-15 22:39:08 +01:00
Damien George
2ac4af6946
py: Allow viper to have type annotations.
...
Viper functions can now be annotated with the type of their arguments
and return value. Eg:
@micropython.viper
def f(x:int) -> int:
return x + 1
2014-08-15 16:45:41 +01:00
Damien George
9b7a8ee8f1
py: Fix mult by negative number of tuple, list, str, bytes.
...
Multiplication of a tuple, list, str or bytes now yields an empty
sequence (instead of crashing). Addresses issue #799
Also added ability to mult bytes on LHS by integer.
2014-08-13 13:22:24 +01:00
Damien George
1ddd844815
extmod: Finish rename of zlib to zlibd; enable zlibd on stmhal.
2014-08-12 23:23:53 +01:00
Paul Sokolovsky
5073d3da07
tests: Add test for zlibd module.
2014-08-13 00:26:26 +03:00
Damien George
bb91f1195a
py: Improve range: add len, subscr, proper print.
...
Can now index ranges with integers and slices, and reverse ranges
(although reversing is not very efficient).
Not sure how useful this stuff is, but gets us closer to having all of
Python's builtins.
2014-08-12 19:41:18 +01:00
Damien George
4c03b3a899
py: Implement builtin reversed() function.
...
reversed function now implemented, and works for tuple, list, str, bytes
and user objects with __len__ and __getitem__.
Renamed mp_builtin_len to mp_obj_len to make it publically available (eg
for reversed).
2014-08-12 18:33:40 +01:00
Paul Sokolovsky
9749b2fb0d
objstr: Make sure that bytes are indexed as bytes, not as unicode.
...
Fixes #795 .
2014-08-11 22:38:00 +03:00
Paul Sokolovsky
5f930337bc
objarray: Implement equality testing between arrays and other buffers.
2014-08-10 16:22:57 +03:00
Damien George
b92e7533d3
tests, pyb: Update pin test.
2014-08-08 22:38:58 +01:00
Paul Sokolovsky
d0f5e61ab5
py: Implement __file__ attribute for modules.
2014-07-28 21:21:59 +03:00
Paul Sokolovsky
512465bc66
tests: Add testcase for read by length past EOF.
...
Currently broken for unicode input streams.
2014-07-22 00:11:37 +03:00
Damien George
1694bc733d
py: Add stream reading of n unicode chars; unicode support by default.
...
With unicode enabled, this patch allows reading a fixed number of
characters from text-mode streams; eg file.read(5) will read 5 unicode
chars, which can made of more than 5 bytes.
For an ASCII stream (ie no chars > 127) it only needs to do 1 read. If
there are lots of non-ASCII chars in a stream, then it needs multiple
reads of the underlying object.
Adds a new test for this case. Enables unicode support by default on
unix and stmhal ports.
2014-07-19 18:34:04 +01:00
Paul Sokolovsky
a1760a56ff
test: Add run-tests-exp.sh, script to run testsuite with only sh dependency.
...
This script uses expected test results as generated by run-tests --write-exp,
and requires only standard unix shell funtionality (no bash). It is useful
to run testsuite on embedded systems, where there's no CPython and Bash.
2014-07-13 18:49:56 +03:00
Paul Sokolovsky
2cf381081a
run-tests: Add option to write CPython's test results to .exp files.
...
Mostly to run testsuite on targets which doesn't have CPython.
2014-07-12 16:34:51 +03:00
Paul Sokolovsky
2097c8b1e1
moductypes: Add symbolic constants to specify bitfield position/length.
2014-07-11 00:06:36 +03:00
Paul Sokolovsky
8215847b4d
moductypes: Foreign data interface module, roughly based on ctype ideas.
...
But much smaller and memory-efficient. Uses Python builtin data structures
(dict, tuple, int) to describe structure layout.
2014-07-09 19:28:24 +03:00
Damien George
539681fffd
tests: Rename test scripts, changing - to _ for consistency.
...
From now on, all new tests must use underscore.
Addresses issue #727 .
2014-07-05 06:14:29 +01:00
Damien George
0182385ab0
py: Automatically ake __new__ a staticmethod.
...
Addresses issue #622 .
2014-07-05 05:55:00 +01:00
Damien George
41736f8201
tests: Write output in byte mode, not text mode.
...
This enables testing unicode and non-unicode implementations.
2014-06-28 10:29:12 +01:00
Damien George
b3a50f0f3e
Merge branch 'master' into unicode
...
Conflicts:
py/mpconfig.h
2014-06-28 10:27:15 +01:00
Paul Sokolovsky
8993fb6cf0
py: Add protection against printing too nested or recursive data structures.
...
With a test which cannot be automatically validated so far.
2014-06-28 02:25:04 +03:00
Paul Sokolovsky
ed07d035d5
tests: Add basic test for unicode file i/o.
2014-06-27 00:04:20 +03:00
Paul Sokolovsky
63143c94ce
tests: Test for explicit start/end args to str methods for unicode.
2014-06-27 00:04:20 +03:00
Paul Sokolovsky
b1949e4c09
tests: Add tests for unicode find()/rfind()/index().
2014-06-27 00:04:19 +03:00
Paul Sokolovsky
17994d1bd3
tests: Add test for unicode string iteration.
2014-06-27 00:04:19 +03:00
Chris Angelico
1e3781bc35
tests: Add unicode test.
2014-06-27 00:04:17 +03:00
Paul Sokolovsky
16ac4962ae
tests: Add test for catching infinite function recursion.
...
Put into misc/ to not complicate life for builds with check disabled.
2014-06-27 00:03:56 +03:00
Paul Sokolovsky
7a2f166949
modstruct: Fix alignment handling issues.
...
Also, factor out mp_binary_get_int() function.
2014-06-25 23:34:44 +03:00
Paul Sokolovsky
f605172d2b
tests/float/: Skip tests if "math" module is not available.
2014-06-20 18:00:23 +03:00
Paul Sokolovsky
74c710187c
bench: Three ways to process a byte buffer.
2014-06-19 22:27:13 +03:00
Paul Sokolovsky
59ced651b5
bench: Add test for map() vs inplace operations in array-likes.
...
map() is 5 times slower. That's mostly because of inefficiency of creating
containers from iterables of unknown length (like map()).
2014-06-19 22:19:24 +03:00
Paul Sokolovsky
17db096505
bench: Add tests for constructing various containers from iterator.
...
Both "bound" (like, length known) and "unbound" (length unknown) are tested.
All of list, tuple, bytes, bytesarray offer approximately the same
performance, with "unbound" case being 30 times slower.
2014-06-19 21:44:33 +03:00
Paul Sokolovsky
e53d2197e4
bench: Add test for function call overhead.
...
For a trivial operation, calling a function is 5 times slower than doing
operation inline.
2014-06-19 20:49:03 +03:00
Paul Sokolovsky
2ec38a17d4
objstr: Be 8-bit clean even for repr().
...
This will allow roughly the same behavior as Python3 for non-ASCII strings,
for example, print("<phrase in non-Latin script>".split()) will print list
of words, not weird hex dump (like Python2 behaves). (Of course, that it
will print list of words, if there're "words" in that phrase at all, separated
by ASCII-compatible whitespace; that surely won't apply to every human
language in existence).
2014-06-14 01:21:13 +03:00
Paul Sokolovsky
fbdf2f1d63
py: Rename builtin "io" to "_io".
...
Functionality we provide in builtin io module is fairly minimal. Some
code, including CPython stdlib, depends on more functionality. So, there's
a choice to either implement it in C, or move it _io, and let implement other
functionality in Python. 2nd choice is pursued. This setup matches CPython
too (_io is builtin, io is Python-level).
2014-06-12 01:22:25 +03:00
Paul Sokolovsky
f4bf065dac
tests: Add testcases for "complicated" args to generator functions.
2014-06-11 20:43:47 +03:00
Damien George
58cbb4d661
py: Implement __contains__ special method.
2014-06-10 23:07:56 +01:00
Paul Sokolovsky
195de3247b
objtype: Fix passing of class param to inherited classmethods.
...
This is getting more and more tangled, but that's old news.
2014-06-08 22:28:44 +03:00
Damien George
4297fed1c3
tests: Run 'micropython' tests on pyboard.
2014-06-08 13:46:03 +01:00
Damien George
9e951498b2
tests: Add more tests for default keyword-only args.
2014-06-08 12:58:32 +01:00
Damien George
c06427c019
tests: Fix default arg test.
2014-06-08 00:12:32 +01:00
Paul Sokolovsky
b4efac14cd
py: Make sure getattr() works with non-interned strings (by interning them).
2014-06-08 01:15:06 +03:00
Damien George
f0778a7ccb
py: Implement default keyword only args.
...
Should finish addressing issue #524 .
2014-06-07 22:01:00 +01:00
Paul Sokolovsky
b56a53dfd6
Merge pull request #667 from Rosuav/testfixes
...
A couple of small fixes to run-tests
2014-06-06 22:23:23 +03:00
Dave Hylands
b69f9fa31f
Fix str.modulo when precision is specified.
2014-06-05 23:09:02 -07:00
Chris Angelico
047db2299c
Turn the Travis CI test skipping mechanism into something more generic
2014-06-06 07:51:01 +10:00
Chris Angelico
88b11b50e5
Figure out the test_name before using it (significant only to Travis skips)
2014-06-06 07:51:01 +10:00
Damien George
d4c2bddd0c
py: Raise TypeError when trying to format non-int with %x,%o,%X.
...
This behaviour follows Python 3.5 standard (in 3.4 it's a
DeprecationWarning which we'd rather make a TypeError).
2014-06-05 19:44:54 +01:00
Chris Angelico
daf973ae00
Change comments (mainly URLs) to no longer specifically say Python 3.3
2014-06-06 03:51:03 +10:00
Damien George
c074cd38c3
Merge pull request #663 from Rosuav/floatpercentx
...
Remove tests that fail under CPython 3.5
2014-06-05 18:39:08 +01:00
Paul Sokolovsky
75ce9256b2
objstr: Implement "%(key)s" % {} formatting for strings and dicts.
...
Also, make sure that args to "*" format specifiers are bounds-checked
properly and don't lead for segfaults in case of mismatch.
2014-06-05 20:06:15 +03:00
Chris Angelico
7a6e09635a
Remove tests that fail under CPython 3.5
...
See http://bugs.python.org/issue19995 for rationale. As micropython currently
aims for Python 3.3 compatibility I have not changed behaviour, but this
change allows the test suite to be run against a newer Python without having
spurious failures.
2014-06-05 22:34:11 +10:00
Damien George
bcb6ca4d5e
py: Implement full behaviour of dict.update(), and dict().
...
Add keyword args to dict.update(), and ability to take a dictionary as
argument.
dict() class constructor can now use dict.update() directly.
This patch loses fast path for dict(other_dict), but is that really
needed? Any anyway, this idiom will now re-hash the dictionary, so is
arguably more memory efficient.
Addresses issue #647 .
2014-06-03 12:53:44 +01:00
Damien George
4d659f566f
tests: Add feature test for when heap allocation is disabled.
2014-05-31 18:33:16 +01:00
Damien George
a053e37b2c
tests: Change --test_dirs to --test-dirs.
2014-05-31 18:11:01 +01:00
Damien George
e7412ab37b
Merge pull request #632 from stinos/tests-dir-argument
...
tests: Add argument to allow specifying which directories to test
2014-05-31 18:11:03 +01:00
Damien George
5b5562c1d1
py: Fix stack underflow with optimised for loop.
2014-05-31 17:59:11 +01:00
Damien George
049a01d148
tests: Add another test for break-from-for-loop.
2014-05-31 16:56:15 +01:00
Kim Bauters
a3f4b83018
add methods isspace(), isalpha(), isdigit(), isupper() and islower() to str
2014-05-31 07:30:57 +01:00
Paul Sokolovsky
ccd0e0afcd
tests: Add test for break in for.
...
For #635 / 25c84643b6
.
2014-05-31 00:43:41 +03:00
Paul Sokolovsky
8827682b35
objstr: *strip(): If nothing is stripped, don't create dup string.
2014-05-30 03:15:17 +03:00
Paul Sokolovsky
bcdffe53c6
objstr: *strip(): Fix handling of one-char subject strings.
2014-05-30 03:15:17 +03:00
Damien George
f55cf10101
py: Implement bignum '&' with negatives on lhs and rhs.
...
Needs proper coverage testing. Doesn't implement -ve & -ve.
Addresses issue #611 .
2014-05-29 15:01:49 +01:00
stijn
8ac3b578e5
tests: Add argument to allow specifying which directories to test
2014-05-28 14:33:30 +02:00
Paul Sokolovsky
d07bf029b7
tests: Add small testcase for 3-arg slices.
2014-05-26 02:02:47 +03:00
Paul Sokolovsky
5fd5af98d0
objlist: Implement support for arbitrary (3-arg) slices.
2014-05-25 22:12:56 +03:00
Paul Sokolovsky
2705f4c782
objlist: Implement growing slice assignment.
...
This means that complete slice operations are supported for lists (but not
for bytearray's and array.array's).
2014-05-25 02:36:12 +03:00
Paul Sokolovsky
d098c6bf85
objstr: Implement .endswith().
2014-05-24 22:46:51 +03:00
Paul Sokolovsky
806ea1f6ca
py: Initial attempts to actually allow implementing __new__ in Python.
...
Caveat is that __new__ should recurse to base class __new__, and ultimately,
object.__new__ is what handles instance allocation.
2014-05-22 00:32:00 +03:00
Paul Sokolovsky
a8408a8abe
objtype: super: Fall back to "object" lookup as last resort.
...
Also, define object.__init__() (semantically empty, purely CPython compat
measure). Addresses #520 .
2014-05-21 22:27:03 +03:00
Damien George
0fd01683c6
Merge pull request #607 from Anton-2/osx-clang
...
Allow compilation of unix port under clang on OS X
2014-05-21 19:51:05 +01:00
Paul Sokolovsky
66ab571cca
tests: Update subclass-native2.py for __new__/__init__ refactor.
...
Now case of subclassing tuple works, and list is broken, see comments.
2014-05-19 21:56:07 +03:00
Paul Sokolovsky
c18ef2a9dd
objstr: startswith(): Accept optional "start" arg.
2014-05-15 21:33:18 +03:00
Paul Sokolovsky
70328e419a
py: Implement more complete bytes comparison handling.
2014-05-15 20:58:40 +03:00
Paul Sokolovsky
ad3baec12f
sequence: Fix yet another case of improper sequence comparison.
...
This time, in mp_seq_cmp_bytes(). How many more cases are still lurking?
2014-05-15 19:09:06 +03:00
Paul Sokolovsky
2a27365854
objstr.c: Partial implementation of .rsplit().
...
sep=None is TODO.
2014-05-14 02:42:20 +03:00
Paul Sokolovsky
7074f25768
tests/int-long.py: Try to expose issue with recent "&" optimization.
2014-05-13 08:24:54 +03:00
Damien George
561e425903
py: Fix bug in mpz_and function.
...
Addresses issue #610 .
2014-05-12 23:27:29 +01:00
Paul Sokolovsky
df94b717b4
modstruct: Implement count specifier for strings (e.g. "100s").
...
Infra for counts of other types is there, need last mile to be implemented.
2014-05-12 23:45:50 +03:00
Antonin ENFRUN
1b901c320b
tests: create result file for test/basics/memoryerror.py .
...
On Mac OS "python3 test/basics/memoryerror.py" never runs out of memory, the process is frozen by the os before.
2014-05-12 00:13:10 +02:00
Paul Sokolovsky
5ebd5f0f19
objstr: Slice indexing: support bytes properly.
2014-05-11 21:22:59 +03:00
Paul Sokolovsky
bfb8819c0c
objstr: Make .split() support bytes.
2014-05-11 21:17:28 +03:00
Paul Sokolovsky
5e5d69b35e
objstr: Make .join() support bytes.
2014-05-11 21:13:01 +03:00
Paul Sokolovsky
ff30666c69
py: Add basic implementation of hasattr() function.
2014-05-11 20:51:30 +03:00
Damien George
1d34e32431
py: frozenset() creates an empty frozenset.
2014-05-11 18:28:48 +01:00
Damien George
c3dcb590b8
Merge pull request #603 from stinos/windows-tests-newline
...
tests: Fix handling of newlines from expected output files on windows
2014-05-11 15:03:57 +01:00
Paul Sokolovsky
eea0118654
py: Give up and make mp_obj_str_get_data() deal with bytes too.
...
This is not fully correct re: error handling, because we should check that
that types are used consistently (only str's or only bytes), but magically
makes lot of functions support bytes.
2014-05-11 13:51:24 +03:00
stijn
a4dbc73e8a
tests: Fix handling of newlines from expected output files
2014-05-11 12:45:02 +02:00
Paul Sokolovsky
b2d4fc06fc
objstr: Make *strip() accept bytes.
2014-05-11 13:17:29 +03:00
Paul Sokolovsky
ce6c10172b
tests: Really fix import.
2014-05-11 03:45:42 +03:00
Paul Sokolovsky
b4acd028b6
tests: Fix import.
2014-05-11 03:40:32 +03:00
Paul Sokolovsky
ea9708092e
objtuple: Go out of the way to support comparison of subclasses.
...
Two things are handled here: allow to compare native subtypes of tuple,
e.g. namedtuple (TODO: should compare type too, currently compared
duck-typedly by content). Secondly, allow user sunclasses of tuples
(and its subtypes) be compared either. "Magic" I did previously in
objtype.c covers only one argument (lhs is many), so we're in trouble
when lhs is native type - there's no other option besides handling
rhs in special manner. Fortunately, this patch outlines approach with
fast path for native types.
2014-05-11 03:33:19 +03:00