summaryrefslogtreecommitdiffstatshomepage
path: root/py
Commit message (Collapse)AuthorAge
* objgenerator: Generator must execute in its defining lexical context.Paul Sokolovsky2014-04-17
| | | | | I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator.
* objfun: Add local header.Paul Sokolovsky2014-04-17
| | | | | | | | | 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.
* py: Make built-in 'range' a class.Damien George2014-04-17
| | | | Addresses issue #487.
* build: Simplify build directory layout by putting all headers in genhdr.Damien George2014-04-17
| | | | | Any generated headers go in $(BUILD)/genhdr/, and are #included as 'genhdr/xxx.h'.
* Merge branch 'relocatable-build-dir' of github.com:lurch/micropython into ↵Damien George2014-04-17
|\ | | | | | | lurch-relocatable-build-dir
| * build directory can now be renamedAndrew Scheller2014-04-16
| | | | | | | | | | | | | | | | | | 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
* | Merge pull request #507 from pfalcon/nlr-setjmpDamien George2014-04-17
|\ \ | | | | | | nlr: Add implementation using setjmp/longjmp.
| * | nlr: Add implementation using setjmp/longjmp.Paul Sokolovsky2014-04-17
| |/ | | | | | | | | Having an optimized asm implementation is good, but if we want portability, that's it.
* | Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-17
|\ \
| * \ Merge pull request #501 from dhylands/fix-gen-failDamien George2014-04-17
| |\ \ | | |/ | |/| Remove generated .h file if the generation process fails.
| | * Have make remove targets if a recipie fails.Dave Hylands2014-04-16
| | |
* | | py: Add cmath module, for complex math. Disabled by default.Damien George2014-04-17
| | | | | | | | | | | | Not all functions implemented. Not enabled on pyboard.
* | | py: Enable builtin 'property' by default.Damien George2014-04-17
| | |
* | | py: Tidy up variables in VM, probably fixes subtle bugs.Damien George2014-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | py: Don't assert but go to unsupported_op in mp_binary_op for small int.Damien George2014-04-17
|/ /
* | py: Add len(bytes).Damien George2014-04-15
| |
* | py: Add builtin functions bin and oct, and some tests for them.Damien George2014-04-15
|/
* Merge pull request #493 from aitjcize/patchDamien George2014-04-15
|\ | | | | Move entry_table to separated header file.
| * Rename header file.AZ Huang2014-04-15
| |
| * Move entry_table to separated header file.AZ Huang2014-04-15
| |
* | py: Fix builtin hex to print prefix.Damien George2014-04-15
| | | | | | | | I was too hasty. Still a one-liner though.
* | py: Add hex builtin function.Damien George2014-04-15
|/ | | | A one-liner, added especially for @pfalcon :)
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-14
|\
| * builtinimport: Add basic support for namespace packages.Paul Sokolovsky2014-04-15
| | | | | | | | | | | | | | | | | | | | 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.
| * py: Implement __delitem__ method for classes.Paul Sokolovsky2014-04-15
| |
* | py: Clean up and add comments to makeqstrdata.Damien George2014-04-14
|/
* Merge pull request #479 from lurch/patch-1Damien George2014-04-14
|\ | | | | Don't allow both ENDIANNESSes to be set
| * Don't allow both ENDIANNESSes to be setAndrew Scheller2014-04-14
| | | | | | | | | | 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.
* | Make USE_COMPUTED_GOTO a config option in mpconfig.h.Damien George2014-04-14
| | | | | | | | Disabled by default. Enabled in unix port.
* | Use computed goto instead of switching op-codes.AZ Huang2014-04-15
| |
* | Fix parallel build.AZ Huang2014-04-15
|/
* modsys: Implement sys.version.Paul Sokolovsky2014-04-14
| | | | | | | | The logic appears to be that (at least beginning of) sys.versions is the version of reference Python language implemented, not version of particular implementation. Also, bump set versions at 3.4.0, based on @dpgeorge preference.
* objstr: Allow to define statically allocated str objects.Paul Sokolovsky2014-04-14
| | | | | Similar to tuples, lists, dicts. Statically allocated strings don't have hash computed.
* qstr, objstr: Make sure that valid hash != 0, treat 0 as "not computed".Paul Sokolovsky2014-04-14
| | | | | This feature was proposed with initial hashing RFC, and is prerequisite for seamless static str object definition.
* objdict: Add __delitem__.Paul Sokolovsky2014-04-13
|
* objdict: Add __setitem__.Paul Sokolovsky2014-04-13
|
* py: Add property object, with basic functionality.Damien George2014-04-13
| | | | Enabled by MICROPY_ENABLE_PROPERTY.
* py: Detect ZeroDivisionError properly for floats.Damien George2014-04-13
|
* py: Fix SyntaxError exception: don't have a block name, so pass NULL.Damien George2014-04-13
|
* py: Fix up source-line calculation.Damien George2014-04-13
| | | | Should address issue #475.
* Merge branch 'master' of github.com:micropython/micropythonDamien George2014-04-13
|\
| * modsys: Implement sys.byteorder.Paul Sokolovsky2014-04-13
| |
| * modsys: Implement basic sys.version_info.Paul Sokolovsky2014-04-13
| |
* | py: Adjust #includes in lexerunix.c.Damien George2014-04-13
|/
* Merge pull request #470 from errordeveloper/misc_fix/lexerunixDamien George2014-04-13
|\ | | | | py: don't look for any additional headers when lexerunix is disabled
| * py: don't look for any additional headers when lexerunix is disabledIlya Dmitrichenko2014-04-12
| |
* | Merge pull request #471 from errordeveloper/misc_fix/unistdDamien George2014-04-13
|\ \ | | | | | | py: the entire `<unistd.h>` shouldn't be needed
| * | py: the entire `<unistd.h>` shouldn't be neededIlya Dmitrichenko2014-04-12
| |/
* | py: Modify makeqstrdata to recognise better the output of CPP.Damien George2014-04-13
| |
* | py: Add more #if's for configurable MOD_SYS.Damien George2014-04-13
| |