summaryrefslogtreecommitdiff
path: root/py
AgeCommit message (Collapse)Author
2018-11-09Fix output overflow and make help translatableScott Shawcroft
2018-11-09Build refinement to handle warnings and quiet outputScott Shawcroft
2018-10-24Merge pull request #1167 from notro/cpython_stdlibScott Shawcroft
Support CPython standard library
2018-10-18Use python3 for mpy-toolScott Shawcroft
2018-10-17Add debug info to the generated frozen_mpy.cScott Shawcroft
It adds size info and uses macros for byte code to make it more readable.
2018-10-07modsys: exc_info: Add tracebackNoralf Trønnes
Add traceback chain to sys.exec_info()[2]. No actual frame info is added, but just enough to recreate the printed exception traceback. Used by the unittest module which collects errors and failures and prints them at the end.
2018-10-07py/objboundmeth: Support __func__ property as in CPythonNoralf Trønnes
This gives access to the function underlying the bound method. Used in the converted CPython stdlib logging.Formatter class to handle overrriding a default converter method bound to a class variable. The method becomes bound when accessed from an instance of that class. I didn't investigate why CircuitPython turns it into a bound method.
2018-10-07py/builtinimport: Set __file__ on MPY modulesNoralf Trønnes
This sets the __file__ property on MPY modules like how it's done on pure python modules.
2018-10-07fix compilation errors in emitinlinethumb.cUri Shaked
2018-08-25Revert "py/vm: Improve performance of opcode dispatch when using switch stmt."Noralf Trønnes
This reverts commit 869024dd6e62905b7e1069b547856a769b3b24ba. Ctrl-C stopped producing KeyboardInterrupt with this change on CircuitPython. The Unix and stm32 ports handles Ctrl-C differently with a handler which is probably why they where not affected. Fixes #1092
2018-08-17Merge pull request #1064 from notro/i2cslaveScott Shawcroft
Add busio.I2CSlave
2018-08-16Fix test that broke due to decompressing to too small of a scope.Scott Shawcroft
2018-08-16Fix esp and samdScott Shawcroft
2018-08-16fix mpy-crossScott Shawcroft
2018-08-16Compress all translated strings with Huffman coding.Scott Shawcroft
This saves code space in builds which use link-time optimization. The optimization drops the untranslated strings and replaces them with a compressed_string_t struct. It can then be decompressed to a c string. Builds without LTO work as well but include both untranslated strings and compressed strings. This work could be expanded to include QSTRs and loaded strings if a compress method is added to C. Its tracked in #531.
2018-08-16Add i2cslave.I2CSlave bindingsNoralf Trønnes
2018-08-10Fix translation newlinesScott Shawcroft
Escape table was incorrect
2018-08-09Rework escaping and fix ESP build.Scott Shawcroft
2018-08-09Update filter and handle nested quotesScott Shawcroft
2018-08-09Two fixes and translate more strings.Scott Shawcroft
* Fix finding translations with escaped characters. * Add back \r to translations since its needed by screen.
2018-08-07Support internationalisation.Scott Shawcroft
2018-08-02Rename to SRC_QSTR_PREPROCESSOR for clarity.Scott Shawcroft
2018-08-02Handle emitnative.c which is #included into other .c files.Scott Shawcroft
2018-08-02Speed up QSTR creation by pre-filtering files before pre-processing.Scott Shawcroft
2018-07-28Merge remote-tracking branch 'adafruit/master' into micropython-25ae98f-mergeDan Halbert
2018-07-28merge finishedDan Halbert
2018-07-25Merge remote-tracking branch 'adafruit/3.x' into import_mergeScott Shawcroft
2018-07-23WIP: complete manual inspection of all significant changesDan Halbert
2018-07-19Prevent repetitive recursive scanning of dicts when making them long-livedDan Halbert
2018-07-16Merge branch 'master' into micropython-25ae98f-mergeDan Halbert
2018-07-14do not call property if referenced by class, not objectDan Halbert
2018-07-13compiles and runs; hangs on import storage;storage.VfsFat.<tab>Dan Halbert
2018-07-12continued WIP: almost compilingDan Halbert
2018-07-11WIP: after merge; before testingDan Halbert
2018-07-03Limit qstr pool size to reduce memory waste.Scott Shawcroft
2018-07-03Always collect after an importScott Shawcroft
Imports generate a lot of garbage so cleaning it up immediately reduces the likelihood longer lived data structures don't end up in the middle of the heap. Fixes #856
2018-07-03Analysis fixes and long lived tweaks.Scott Shawcroft
2018-06-22py/compile: Combine expr, xor_expr and and_expr into one function.Damien George
This and the previous 4 commits combined have change in code size of: bare-arm: -92 minimal x86: -544 unix x64: -544 unix nanbox: -712 stm32: -116 cc3200: -128 esp8266: -348 esp32: -232
2018-06-22py/compile: Combine or_test and and_test compile functions.Damien George
2018-06-22py/compile: Combine global and nonlocal statement compile functions.Damien George
2018-06-22py/compile: Combine subscript_2 and subscript_3 into one function.Damien George
2018-06-22py/compile: Combine break and continue compile functions.Damien George
2018-06-20py/stream: Remove stray empty line at start of file.Damien George
This was accidentally added in 6abede2ca9e221b6aefcaccbda0c89e367507df1
2018-06-20py: Add checks for stream objects in print() and sys.print_exception().Damien George
2018-06-20py/stream: Update comment for mp_stream_write_adaptor.Damien George
2018-06-18py/objarray: Replace 0x80 with new MP_OBJ_ARRAY_TYPECODE_FLAG_RW macro.Damien George
2018-06-18py/stream: Introduce and use efficient mp_get_stream to access stream_p.Damien George
The existing mp_get_stream_raise() helper does explicit checks that the input object is a real pointer object, has a non-NULL stream protocol, and has the desired stream C method (read/write/ioctl). In most cases it is not necessary to do these checks because it is guaranteed that the input object has the stream protocol and desired C methods. For example, native objects that use the stream wrappers (eg mp_stream_readinto_obj) in their locals dict always have the stream protocol (or else they shouldn't have these wrappers in their locals dict). This patch introduces an efficient mp_get_stream() which doesn't do any checks and just extracts the stream protocol struct. This should be used in all cases where the argument object is known to be a stream. The existing mp_get_stream_raise() should be used primarily to verify that an object does have the correct stream protocol methods. All uses of mp_get_stream_raise() in py/stream.c have been converted to use mp_get_stream() because the argument is guaranteed to be a proper stream object. This patch improves efficiency of stream operations and reduces code size.
2018-06-12extmod/uos_dupterm: Use native C stream methods on dupterm object.Damien George
This patch changes dupterm to call the native C stream methods on the connected stream objects, instead of calling the Python readinto/write methods. This is much more efficient for native stream objects like UART and webrepl and doesn't require allocating a special dupterm array. This change is a minor breaking change from the user's perspective because dupterm no longer accepts pure user stream objects to duplicate on. But with the recent addition of uio.IOBase it is possible to still create such classes just by inheriting from uio.IOBase, for example: import uio, uos class MyStream(uio.IOBase): def write(self, buf): # existing write implementation def readinto(self, buf): # existing readinto implementation uos.dupterm(MyStream())
2018-06-12py/mkrules.mk: Regenerate all qstrs when config files change.Damien George
A port can define QSTR_GLOBAL_DEPENDENCIES to add extra files.
2018-06-12extmod/moduhashlib: Allow to disable the sha256 class.Yonatan Goldschmidt
Via the config value MICROPY_PY_UHASHLIB_SHA256. Default to enabled to keep backwards compatibility. Also add default value for the sha1 class, to at least document its existence.