aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-04-07tests: Fix few tests which depend on order of elements in set.Paul Sokolovsky
2014-04-07pip-micropython: Require command verb, but restrict to "install" only.Paul Sokolovsky
So, pip-micropython can/should be run as normal pip: pip-micropython install micropython-unittest
2014-04-07tests: Fix tests with sets to print sorted set.Damien George
2014-04-07py: Fix str.replace for case when arg 0 or 1 is empty string.Damien George
2014-04-06unix-cpy: Pass emit opt to mp_compile.Damien George
2014-04-06tests: Fix few tests which depend on order of elements in dict.Paul Sokolovsky
With dict being unordered of course.
2014-04-06tests/dict2.py: Add combined test for dict(dict) and dict equality.Paul Sokolovsky
2014-04-06objdict: Implement equality operator.Paul Sokolovsky
Sure, it's O(n^2).
2014-04-06py: Fix dict.copy() and low-level map/set allocation.Paul Sokolovsky
Two things: 1) set flags in copy properly; make mp_map_init() not be too smart and do something with requested alloc size. Policy of using prime numbers for alloc size is high-level policy which should be applied at corresponding high levels. Low-level functions should just do what they're asked to, because they don't have enough context to be smarter than that. For example, munging with alloc size of course breaks dict copying (as changing sizes requires rehashing).
2014-04-06objdict: Support creating dict from another dict.Paul Sokolovsky
2014-04-06py: Implement more features in native emitter.Damien George
On x64, native emitter now passes 70 of the tests.
2014-04-06py: Add option to compiler to specify default code emitter.Damien George
Also add command line option to unix port to select emitter.
2014-04-06py: str.split: handle non-default separator.Damien George
2014-04-06py: Revert mp_load_attr() to its previous state (not supporting default val).Paul Sokolovsky
Based on the discussion in #433. mp_load_attr() is critical-path function, so any extra check will slowdown any script. As supporting default val required only for getattr() builtin, move correspending implementation there (still as a separate function due to concerns of maintainability of such almost-duplicated code instances).
2014-04-05Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-05py: Make mp_map_lookup not allocate memory on removal.Damien George
2014-04-06py: Optimize locals()/globals() implementation.Paul Sokolovsky
2014-04-05Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-05py: Replace stream_p with *stream_p in mp_obj_type_t.Damien George
This is to reduce ROM usage. stream_p is used in file and socket types only (at the moment), so seems a good idea to make the protocol functions a pointer instead of the actual structure. It saves 308 bytes of ROM in the stmhal/ port, 928 in unix/.
2014-04-06py: Implement globals() and locals() builtins.Paul Sokolovsky
2014-04-05py: Make all objects and instances derive from object.Damien George
This makes isinstance(X, object) and issubclass(X, object) true for all X.
2014-04-05py: Make globals and locals proper dictionary objects.Damien George
Finishes addressing issue #424. In the end this was a very neat refactor that now makes things a lot more consistent across the py code base. It allowed some simplifications in certain places, now that everything is a dict object. Also converted builtins tables to dictionaries. This will be useful when we need to turn builtins into a proper module.
2014-04-05py: Change module globals from mp_map_t* to mp_obj_dict_t*.Damien George
Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
2014-04-05py: Fix float printing on stmhal.Damien George
2014-04-05Improve GC finalisation code; add option to disable it.Damien George
2014-04-05Merge pull request #425 from iabdalkader/delDamien George
Implement del
2014-04-05py: Change nlr_jump to nlr_raise, to aid in debugging.Damien George
This does not affect code size or performance when debugging turned off. To address issue #420.
2014-04-05tests: Add test to check issue #429.Damien George
2014-04-05Merge pull request #436 from dhylands/pfenv-print-intDamien George
Change pfenv_print_int to take machine_uint_t rather than unsinged in
2014-04-05Merge pull request #435 from dhylands/str-modulo-floatDamien George
Allow floating point arguments with %d,i,u,o,x,X formats
2014-04-05Merge pull request #433 from pfalcon/getattr-3argDamien George
py: Support 3-arg getattr() builtin (with default value).
2014-04-05Change pfenv_print_int to take machine_uint_t rather than unsinged inDave Hylands
With this change, the following works: >>> print('%#x' % 0x1234567890abcdef) 0x1234567890abcdef
2014-04-05Merge branch 'master' of github.com:micropython/micropythonDamien George
2014-04-05py: Fix delete operation on map/dict and set objects.Damien George
Hash table can now be completely full (ie now NULL entry) before a resize is triggered. Use sentinel value to indicate delete entry in the table.
2014-04-05stmhal: autoflash now enters serial comms after flashing.Damien George
2014-04-05Allow floating point arguments with %d,i,u,o,x,X formatsDave Hylands
2014-04-05mp_obj_get_int(): Add warning against adding implicit float->int conversion.Paul Sokolovsky
2014-04-05Move del to localsmux
2014-04-05py: Fix bug in DELETE_SUBSCR bytecode, decreasing sp too much.Damien George
2014-04-05tests: Add test for dict delete. It fails.Damien George
2014-04-05py: Implement DELETE_SUBSCR bytecode; implement mp_obj_dict_delete.Damien George
2014-04-05Merge pull request #431 from pfalcon/unbreak-map-removeDamien George
map: When removing a key, don't NULL the entry, but mark as deleted.
2014-04-05objfun: Add equality support.Paul Sokolovsky
2014-04-05stmhal: Add more escape seqs; add debugging output for escape seq.Damien George
2014-04-05py: Support 3-arg getattr() builtin (with default value).Paul Sokolovsky
2014-04-05Merge branch 'xterm-home-end' of github.com:pfalcon/micropython into ↵Damien George
pfalcon-xterm-home-end
2014-04-05objtype: Add equality test for type types.Paul Sokolovsky
2014-04-05py: Allow types to be hashable.Paul Sokolovsky
Quite natural to have d[int] = handle_int .
2014-04-05py: Put default namespace into module __main__.Paul Sokolovsky
That's how CPython has it, in particular, "import __main__" should work.
2014-04-05map: When removing a key, don't NULL the entry, but mark as deleted.Paul Sokolovsky
When searching next time, such entry should be just skipped, not terminate the search. It's known that marking techique is not efficient at the presense of many removes, but namespace usage should not require many deletes, and as for user dictionaries - well, open addressing map table with linear rehashing and load factor of ~1 is not particularly efficient at all ;-). TODO: May consider "shift other entries in cluster" approach as an alternative.