summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2014-04-19modstruct: Fix .calcsize() to account for struct type/alignment.Paul Sokolovsky
2014-04-19modstruct: Support 'q' & 'Q' type codes.Paul Sokolovsky
2014-04-18Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-18py: Add mp_binary_set_val_array_from_int, to store an int directly.Damien George
2014-04-18py: Allow to pass buffer protocol flags to get_buffer helper funcs.Damien George
2014-04-18py: Add typecode to buffer protocol.Damien George
When querying an object that supports the buffer protocol, that object must now return a typecode (as per binary.[ch]). This does not have to be honoured by the caller, but can be useful for determining element size.
2014-04-18py: Tidy up function argument error messages.Damien George
We are not as verbose as CPython, and maybe a bit too cryptic sometimes.
2014-04-18py: Tidy up array.array; add more error handling.Damien George
2014-04-18sequence: Further simplify sequence comparison.Paul Sokolovsky
2014-04-18sequence: Fix glaring bug in sequence comparison.Paul Sokolovsky
2014-04-18objfloat: Try to achieve the same float printing format as CPython does.Paul Sokolovsky
Test usecase I used is print(time.time()) and print(time.time() - time.time()). On Linux/Glibc they now give the same output as CPython 3.3. Specifically, time.time() gives non-exponential output with 7 decimal digits, and subtraction gives exponential output e-06/e-07.
2014-04-18inlinethumb: Add wfi, cpsid and cpsie instructions.Damien George
2014-04-18py: from import * should not import symbols starting with underscore.Paul Sokolovsky
I skipped implementing this initially, but then it causes __name__ of current module be overwritten and relative imports fail.
2014-04-17py: Rename USE_COMPUTED_GOTOS to USE_COMPUTED_GOTO and enable on stmhal.Damien George
On stmhal, computed gotos make the binary about 1k bigger, but makes it run faster, and we have the room, so why not. All tests pass on pyboard using computed gotos.
2014-04-17py: Add MP_OBJ_STOP_ITERATION and make good use of it.Damien George
Also make consistent use of MP_OBJ_NOT_SUPPORTED and MP_OBJ_NULL. This helps a lot in debugging and understanding of function API.
2014-04-17py: Merge BINARY_OP_SUBSCR and store_subscr (w/ delete) into subscr.Damien George
mp_obj_t->subscr now does load/store/delete.
2014-04-17py: Simplify objfun/objgenerator connection, no need to call bc_get.Damien George
2014-04-17Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-17py: Fix pfenv_print_strn to return correct number of chars printed.Damien George
With this fix, all tests in tests/basics pass on pyboard.
2014-04-17objgenerator: Generator must execute in its defining lexical context.Paul Sokolovsky
I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
2014-04-17objfun: Add local header.Paul Sokolovsky
This follows pattern already used for objtuple, etc.: objfun.h's content is not public - each and every piece of code should not have access to it. It's not private either - with out architecture and implementation language (C) it doesn't make sense to keep implementation of each object strictly private and maintain cumbersome accessors. It's "local" - intended to be used by a small set of "friend" (in C++ terms) objects.
2014-04-17py: Make built-in 'range' a class.Damien George
Addresses issue #487.
2014-04-17build: Simplify build directory layout by putting all headers in genhdr.Damien George
Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
2014-04-17Merge branch 'relocatable-build-dir' of github.com:lurch/micropython into ↵Damien George
lurch-relocatable-build-dir
2014-04-17Merge pull request #507 from pfalcon/nlr-setjmpDamien George
nlr: Add implementation using setjmp/longjmp.
2014-04-17Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-17py: Add cmath module, for complex math. Disabled by default.Damien George
Not all functions implemented. Not enabled on pyboard.
2014-04-17py: Enable builtin 'property' by default.Damien George
2014-04-17py: Tidy up variables in VM, probably fixes subtle bugs.Damien George
Things get tricky when using the nlr code to catch exceptions. Need to ensure that the variables (stack layout) in the exception handler are the same as in the bit protected by the exception handler. Prior to this patch there were a few bugs. 1) The constant mp_const_MemoryError_obj was being preloaded to a specific location on the stack at the start of the function. But this location on the stack was being overwritten in the opcode loop (since it didn't think that variable would ever be referenced again), and so when an exception occurred, the variable holding the address of MemoryError was corrupt. 2) The FOR_ITER opcode detection in the exception handler used sp, which may or may not contain the right value coming out of the main opcode loop. With this patch there is a clear separation of variables used in the opcode loop and in the exception handler (should fix issue (2) above). Furthermore, nlr_raise is no longer used in the opcode loop. Instead, it jumps directly into the exception handler. This tells the C compiler more about the possible code flow, and means that it should have the same stack layout for the exception handler. This should fix issue (1) above. Indeed, the generated (ARM) assembler has been checked explicitly, and with 'goto exception_handler', the problem with &MemoryError is fixed. This may now fix problems with rge-sm, and probably many other subtle bugs yet to show themselves. Incidentally, rge-sm now passes on pyboard (with a reduced range of integration)! Main lesson: nlr is tricky. Don't use nlr_push unless you know what you are doing! Luckily, it's not used in many places. Using nlr_raise/jump is fine.
2014-04-17py: Don't assert but go to unsupported_op in mp_binary_op for small int.Damien George
2014-04-17Merge pull request #501 from dhylands/fix-gen-failDamien George
Remove generated .h file if the generation process fails.
2014-04-17nlr: Add implementation using setjmp/longjmp.Paul Sokolovsky
Having an optimized asm implementation is good, but if we want portability, that's it.
2014-04-16build directory can now be renamedAndrew Scheller
The autogenerated header files have been moved about, and an extra include dir has been added, which means you can give a custom BUILD=newbuilddir option to make, and everything "just works" Also tidied up the way the different Makefiles build their include- directory flags
2014-04-16Have make remove targets if a recipie fails.Dave Hylands
2014-04-15py: Add len(bytes).Damien George
2014-04-15py: Add builtin functions bin and oct, and some tests for them.Damien George
2014-04-15Merge pull request #493 from aitjcize/patchDamien George
Move entry_table to separated header file.
2014-04-15Rename header file.AZ Huang
2014-04-15py: Fix builtin hex to print prefix.Damien George
I was too hasty. Still a one-liner though.
2014-04-15py: Add hex builtin function.Damien George
A one-liner, added especially for @pfalcon :)
2014-04-15Move entry_table to separated header file.AZ Huang
2014-04-14Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-14py: Clean up and add comments to makeqstrdata.Damien George
2014-04-15builtinimport: Add basic support for namespace packages.Paul Sokolovsky
That was easy - just avoid erroring out on seeing candidate dir for namespace package. That's far from being complete though - namespace packages should support importing portions of package from different sys.path entries, here we require first matching entry to contain all namespace package's portions. And yet, that's a way to put parts of the same Python package into multiple installable package - something we really need for *Micro*Python.
2014-04-15py: Implement __delitem__ method for classes.Paul Sokolovsky
2014-04-14Merge pull request #479 from lurch/patch-1Damien George
Don't allow both ENDIANNESSes to be set
2014-04-14Make USE_COMPUTED_GOTO a config option in mpconfig.h.Damien George
Disabled by default. Enabled in unix port.
2014-04-15Use computed goto instead of switching op-codes.AZ Huang
2014-04-15Fix parallel build.AZ Huang
2014-04-14Don't allow both ENDIANNESSes to be setAndrew Scheller
See discussion on https://github.com/micropython/micropython/commit/2da81fa80c4cd965f05ad237d81d9764322fde20 Explicitly set `MP_ENDIANNESS_LITTLE` because that's the #define that is used in code elsewhere.