Damien George
8270e3853d
py: More robust int conversion and overflow checking.
11 years ago
Damien George
a58a7aefbd
Merge pull request #417 from pfalcon/unix-enable-gc
unix: Enable GC.
11 years ago
Damien George
cc7085c1ce
Merge branch 'fix-format-int' of github.com:dhylands/micropython into dhylands-fix-format-int
Conflicts:
py/objstr.c
11 years ago
Dave Hylands
22fe4d7344
Fix str.format to work with {:f/g/e} and ints
Also fix objstr.c to compile when floats disabled.
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
Damien George
a05f5dd952
Merge branch 'master' of github.com:micropython/micropython
11 years ago
Damien George
e90eefc84b
stmhal: Fix servo object; add fpclassify to math functions.
11 years ago
Paul Sokolovsky
78e8e30c87
unix: Enable GC.
GC support for "unix" port was implemented some time ago, but still not
enabled.
11 years ago
Paul Sokolovsky
ad1bac63f7
tests/string-format: Add test for formatting ints with float format.
Fail currently.
11 years ago
Paul Sokolovsky
e807fa8d60
gc: Uses uint defined in misc.h.
11 years ago
Paul Sokolovsky
d440dc0513
unix: Use argv[0] for command name in usage.
11 years ago
Paul Sokolovsky
a55a5469c3
unix: Support #if-able impl-specific cmdline options.
For example, we still build w/o GC enabled, so cannot really set heap size.
11 years ago
Paul Sokolovsky
d4e7e06d7f
unix: Properly recognize and report when script on cmdline not found.
Previosuly just silently exited.
11 years ago
Damien George
094d450003
py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.
11 years ago
Damien George
70f33cde48
py: Fix up so that it can compile without float.
11 years ago
Damien George
af6edc61bd
py: Enable a jump optimisation in the compiler.
11 years ago
Damien George
882b363564
py: Move to Python 3.4.0 compatibility.
Very little has changed. In Python 3.4 they removed the opcode
STORE_LOCALS, but in Micro Python we only ever used this for CPython
compatibility, so it was a trivial thing to remove. It also allowed to
clean up some dead code (eg the 0xdeadbeef in class construction), and
now class builders use 1 less stack word.
Python 3.4.0 introduced the LOAD_CLASSDEREF opcode, which I have not
yet understood. Still, all tests (apart from bytecode test) still pass.
Bytecode tests needs some more attention, but they are not that
important anymore.
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
4d4a7f5354
Merge branch 'pip-micropy' of github.com:pfalcon/micropython into pfalcon-pip-micropy
11 years ago
Damien George
a12be917a4
stmhal: Add timer module; move servo PWM from TIM2 to TIM5.
As per issue #257 , servo is better on TIM5 because TIM2 is connected to
more GPIO.
11 years ago
Damien George
69dee59ce4
stmhal: Add backspace key to readline (along with delete key).
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
b23fbb3126
py: Implement floating point power binop.
11 years ago
Damien George
660aef67c4
py: Allow multiple of str/list/tuple on left by an integer.
11 years ago
Paul Sokolovsky
802d505756
tools: Add pip-micropython to install packages in MicroPython-friendly way.
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
Damien George
e3e0500296
py: Make pfenv.c conform to code conventions.
11 years ago
Damien George
e8e8f212aa
Merge pull request #412 from dhylands/pfenv-strn-stack
Pfenv strn stack
11 years ago
Damien George
ef13e2032d
Merge pull request #410 from dhylands/fix-led
Fix pyb.Led(n) code to work properly.
11 years ago
Damien George
256afcf9f6
Merge pull request #411 from dhylands/pfenv-64-bit
Fix INT_BUF_SIZE to work with 32-bit and 64-bit
11 years ago
Paul Sokolovsky
380cc53bd9
Merge pull request #408 from dhylands/str-quick-tests
Turn off full tests in string-format.py
11 years ago
Dave Hylands
1c6b4b2e24
Reduce stack usage of pfenv_print_strn
11 years ago
Dave Hylands
80359aa96e
Fix INT_BUF_SIZE to work with 32-bit and 64-bit
11 years ago
Dave Hylands
18d21d1abd
Fix pyb.Led(n) code to work properly.
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
Damien George
e09320adb5
py: Remove implicit conversion from int to float.
11 years ago
Damien George
46330bd9b5
Merge pull request #407 from dhylands/str-format
Enhance str.format support
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
Paul Sokolovsky
6ce78c4fae
py: Wrap .__class__ handling in MICROPY_CPYTHON_COMPAT.
Because it's superfluos in the presence of type(), a remenant from Python's
"old classes".
11 years ago
Paul Sokolovsky
b509f73982
objtype: Wrap .__name__ handling in MICROPY_CPYTHON_COMPAT.
Because it's runtime reflection feature, not required for many apps.
Rant time:
Python could really use better str() vs repr() distinction, for example,
repr(type) could be "<class 'foo'>" (as it is now), and str(type) just
"foo". But alas, getting straight name requires adhoc attribute.
11 years ago
Damien George
a8dda295c4
Fix part->port in README.
11 years ago
Damien George
30a5f853dd
Merge pull request #404 from jonmills/patch-1
Update README.md
11 years ago
Damien George
18a6eb9e13
Merge branch 'master' of github.com:micropython/micropython
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