Paul Sokolovsky
e2adff3608
tests/dict2.py: Add combined test for dict(dict) and dict equality.
11 years ago
Damien George
cdd96dff2c
py: Implement more features in native emitter.
On x64, native emitter now passes 70 of the tests.
11 years ago
Damien George
deed087e2c
py: str.split: handle non-default separator.
11 years ago
Damien George
2a037408af
tests: Add test to check issue #429 .
11 years ago
Damien George
95004e5114
py: Fix delete operation on map/dict and set objects.
Hash table can now be completely full (ie now NULL entry) before a
resize is triggered. Use sentinel value to indicate delete entry in the
table.
11 years ago
Dave Hylands
f81a49e464
Allow floating point arguments with %d,i,u,o,x,X formats
11 years ago
Damien George
b6ec51bbf0
tests: Add test for dict delete. It fails.
11 years ago
Paul Sokolovsky
bfb7d6a26d
py: Support 3-arg getattr() builtin (with default value).
11 years ago
Paul Sokolovsky
438d504e27
objtype: Add equality test for type types.
11 years ago
Paul Sokolovsky
91cbe6033a
py: Allow types to be hashable.
Quite natural to have d[int] = handle_int .
11 years ago
Paul Sokolovsky
a7752a4540
run-tests: Elaborate python3 command override capabilities.
11 years ago
Damien George
28390340e5
tests: Make rge-sm.py use less memory (integration step increased).
In addition to memory allocation failure, other problem was that 10**17
was overflowing. Now passes.
11 years ago
Damien George
6902eeda25
py: Add m_malloc_fail function to handle memory allocation error.
A malloc/realloc fail now throws MemoryError.
11 years ago
Paul Sokolovsky
072cf022e0
tests/file-with: Add testcase which failed for @dpgeorge .
Works on x86.
11 years ago
Dave Hylands
6756a37a77
Implements most of str.modulo
The alternate form for floating point doesn't work yet.
The %(name)s form doesn't work yet.
11 years ago
Damien George
4b34c76fd6
Changes to get unix/ port compiling on Cygwin.
11 years ago
Damien George
2309369291
tests: Allow to run tests on pyboard.
To run the tests on the pyboard you need to set the "test_on_pyboard"
variable to "True", and also have tools/pyboard.py available for import
(easiest is to symlink to it).
11 years ago
Paul Sokolovsky
34e1199b3a
run-tests: Allow to override python3 command to use via environment var.
11 years ago
Paul Sokolovsky
c61ce96590
unix file: Implement context manager protocol (for "with" statement).
11 years ago
Damien George
c322c5f07f
py: Fix regress for printing of floats and #if.
Also change formating modifier in test script (it still passes with
original format though).
11 years ago
Paul Sokolovsky
ad1bac63f7
tests/string-format: Add test for formatting ints with float format.
Fail currently.
11 years ago
Damien George
929a675a3d
Change test scripts to use python3; bytecode tests use python3.4.
I upgraded to Python 3.4.0, so needed to make these changes. Hopefully
the tests still run with Python 3.3.x (the scripts use python3 so are
agnostic as to the subversion).
Bytecode tests are tightly coupled to the Python version, and now some
fail against Python 3.4.
11 years ago
Damien George
10e21b9770
Add more tests.
11 years ago
Damien George
93b7faa29a
py: Factor out static/class method unwrapping code; add tests.
11 years ago
Damien George
e4c834fc1e
Add a test.
11 years ago
Damien George
4881566874
py: Add support for sep and end keywords in print.
11 years ago
Damien George
084ef373fb
py: Fix math.{ceil,floor,trunc} to return int.
11 years ago
Dave Hylands
7adc2e0431
Turn off full tests in string-format.py
Add some basic coverage tests
11 years ago
Paul Sokolovsky
51413c8cb6
tests: Add test for implicit float to int conversion (not allowed!)
11 years ago
Dave Hylands
baf6f14deb
Enhance str.format support
This adds support for almost everything (the comma isn't currently
supported).
The "unspecified" type with floats also doesn't behave exactly like
python.
Tested under unix with float and double
Spot tested on stmhal
11 years ago
Damien George
e44d26ae0c
py: Implement __getattr__.
It's not completely satisfactory, because a failed call to __getattr__
should not raise an exception.
__setattr__ could be implemented, but it would slow down all stores to a
user created object. Need to implement some caching system.
11 years ago
Paul Sokolovsky
4db727afea
objstr: Very basic implementation of % string formatting operator.
11 years ago
Damien George
3ff2d03891
py: Fix bug in optimised for .. range.
Don't store final, failing value to the loop variable. This fix also
makes for .. range a bit more efficient, as it uses less store/load
pairs for the loop variable.
11 years ago
Paul Sokolovsky
183faa3b13
tests: Add testcase for multiple inheritance.
11 years ago
Paul Sokolovsky
6ded55a61f
py: Properly implement divide-by-zero handling.
"1/0" is sacred idiom, the shortest way to break program execution
(sys.exit() is too long).
11 years ago
Paul Sokolovsky
f7eaf605c0
py: Fix "TypeError: 'iterator' object is not iterable", doh.
11 years ago
Paul Sokolovsky
f39d3b93da
py: Implement support for generalized generator protocol.
Iterators and ducktype objects can now be arguments of yield from.
11 years ago
Damien George
230fec77d7
py: Implement positional and keyword args via * and **.
Extends previous implementation with * for function calls to * and **
for both function and method calls.
11 years ago
Paul Sokolovsky
7fafb28f6d
objgenerator: Handle default args to generator functions.
Addresses #397 .
11 years ago
Paul Sokolovsky
55ca075cab
vm: Implement CALL_FUNCTION_VAR opcode (foo(*(1, 2, 3))).
11 years ago
Damien George
010043caaf
Add "tracing" to try-reraise2.py test. It now fails.
11 years ago
Paul Sokolovsky
0c904df8e6
vm: Save current active exception on opening new try block.
Required to reraise correct exceptions in except block, regardless if more
try blocks with active exceptions happen in the same except block.
P.S. This "automagic reraise" appears to be quite wasteful feature of Python
- we need to save pending exception just in case it *might* be reraised.
Instead, programmer could explcitly capture exception to a variable using
"except ... as var", and reraise that. So, consider disabling argless raise
support as an optimization.
11 years ago
Paul Sokolovsky
d109676ec0
py: Reraising exception possible only in except block.
11 years ago
Damien George
75f71584a6
tests: Remove unimplemented exceptions from testing.
11 years ago
Paul Sokolovsky
e7286ef2c7
tests: Add "with" statement testcases.
11 years ago
Paul Sokolovsky
3c2b2acd8c
tests: Add testcases for yield from.
11 years ago
Paul Sokolovsky
e9137b94f2
py: Implement getattr() builtin.
11 years ago
Paul Sokolovsky
2447a5b582
py: Support closures with default args.
11 years ago
Damien George
66eaf84b8c
py: Replace mp_const_stop_iteration object with MP_OBJ_NULL.
11 years ago
Paul Sokolovsky
c403076ef8
vm: Implement raise statement w/o args (reraising last exception).
11 years ago