Commit Graph

590 Commits

Author SHA1 Message Date
Paul Sokolovsky dff3f896d7 mp_identity(): Add generic identity function.
Useful as getiter method for objects which are their own iterators, etc.
2014-01-20 18:42:08 +02:00
Paul Sokolovsky 3754c4a040 mp_obj_get_qstr(): Handle MP_OBJ_QSTR. 2014-01-20 18:23:38 +02:00
Damien George 91d457a277 py: Put micropython module init code in builtinmp.c. 2014-01-20 10:30:24 +00:00
Damien George 589233622c Merge pull request #198 from pfalcon/expose-memstat
Expose memory stats functions via "micropython" module.
2014-01-20 02:01:50 -08:00
Paul Sokolovsky 440cc3f028 Expose memory stats functions via "micropython" module.
These are micropython.mem_total(), .mem_current(), .mem_peak(). These are 3
individual functions with simple scalar return value to make sure that
calls to these functions themselves have minimal (hopefully zero) impact on
memory allocation.
2014-01-20 02:20:40 +02:00
Damien George 164774c1c1 Merge branch 'master' of github.com:micropython/micropython 2014-01-20 00:03:03 +00:00
Damien George 7d08935458 Rename unix binary to 'micropython'. 2014-01-20 00:02:39 +00:00
Paul Sokolovsky 159c0f75da Don't implicitly import "sys" module. 2014-01-20 01:57:20 +02:00
Paul Sokolovsky fe2690da0a unix: Implement sys.argv. 2014-01-20 01:00:28 +02:00
Paul Sokolovsky f477bfbc75 Pre-create sys module. 2014-01-20 01:00:28 +02:00
Paul Sokolovsky bb33cc66fb Properly print MP_OBJ_QSTR objects. 2014-01-20 01:00:28 +02:00
Damien George 2c7a1b2ad1 Merge pull request #197 from pfalcon/mod-singletons
Implement modules as singletons Python semantics.
2014-01-19 14:52:07 -08:00
Paul Sokolovsky d720ab5236 Implement modules as singletons Python semantics.
In Python, importing module several times returns same underlying module
object. This also fixes import statement handling for builtin modules.

There're still issues:
1. CPython exposes set of loaded modules as sys.modules, we may want to
do that either.
2. Builtin modules are implicitly imported, which is not really correct.
We should separate registering a (builtin) module and importing a module.
CPython keeps builtin module names in sys.builtin_module_names .
2014-01-20 00:38:39 +02:00
Damien George f438b936e0 Small changes to README. 2014-01-19 18:18:43 +00:00
Damien George 5f7e8dc176 Merge branch 'master' of github.com:micropython/micropython 2014-01-19 17:41:01 +00:00
Damien George b2ebb161d4 stm: Upgrade ST peripheral library from 1.1.0 to 1.3.0. 2014-01-19 17:40:35 +00:00
Paul Sokolovsky db796ef84d Add README for tests/. 2014-01-19 18:51:59 +02:00
Paul Sokolovsky 9954b4b99d Add directory for I/O tests with basic test for file methods. 2014-01-19 18:46:21 +02:00
Damien George 1277753812 stm: Upgrade to latest CMSIS libraries.
CMSIS V3.01 -> V3.20. Now in stm/cmsis to keep separate from ST
libraries.
2014-01-19 16:43:33 +00:00
Paul Sokolovsky 8c3858b016 Move tests in basic/tests/ up one level preparating to multiple test dirs. 2014-01-19 18:41:55 +02:00
Damien George a11ceca807 Change int to uint for n_args in function with variable arguments. 2014-01-19 16:02:09 +00:00
Damien George 136b149e41 py: Add full traceback to exception printing. 2014-01-19 12:38:49 +00:00
Damien George 49f6a99c65 Merge branch 'master' of github.com:micropython/micropython 2014-01-19 11:50:14 +00:00
Damien George cbd2f7482c py: Add module/function/class name to exceptions.
Exceptions know source file, line and block name.

Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
2014-01-19 11:48:48 +00:00
Paul Sokolovsky 50a2d6ff59 Fix incorrect prototype of mp_builtin_open() after args refactor. 2014-01-19 07:50:45 +02:00