<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/map.c, branch v1.6</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.6</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.6'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-12-31T00:24:33+00:00</updated>
<entry>
<title>py/map: In map lookup, check for fixed map independent of ordered map.</title>
<updated>2015-12-31T00:24:33+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-31T00:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6dde019d933175b5c2608b8da2239846e1730838'/>
<id>urn:sha1:6dde019d933175b5c2608b8da2239846e1730838</id>
<content type='text'>
It's possible to have a fixed map that is properly hashed (ie not
simply ordered).
</content>
</entry>
<entry>
<title>py/map: Add fast-path for hashing of map index when it is a qstr.</title>
<updated>2015-12-26T21:15:47+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-12-26T21:15:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bbe8d51bd9ab0c848ee833000dcc93eb78bcbcad'/>
<id>urn:sha1:bbe8d51bd9ab0c848ee833000dcc93eb78bcbcad</id>
<content type='text'>
Map indicies are most commonly a qstr, and adding a fast-path for hashing
of a qstr increases overall performance of the runtime.

On pyboard there is a 4% improvement in the pystone benchmark for a cost
of 20 bytes of code size.  It's about a 2% improvement on unix.
</content>
</entry>
<entry>
<title>py: Use MP_OBJ_NULL instead of NULL when appropriate.</title>
<updated>2015-11-20T14:09:20+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-20T14:09:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=83229d3ffe5f8b6ba9c9f90e4ff0185dc0bab81b'/>
<id>urn:sha1:83229d3ffe5f8b6ba9c9f90e4ff0185dc0bab81b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/map: Store key/value in earliest possible slot in hash table.</title>
<updated>2015-11-19T01:27:28+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-11-19T01:27:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=593faf14c4700afd6c2ba6a281e7d48633e4d688'/>
<id>urn:sha1:593faf14c4700afd6c2ba6a281e7d48633e4d688</id>
<content type='text'>
This change makes the code behave how it was supposed to work when first
written.  The avail_slot variable is set to the first free slot when
looking for a key (which would come from deleting an entry).  So it's
more efficient (for subsequent lookups) to insert a new key into such a
slot, rather than the very last slot that was searched.
</content>
</entry>
<entry>
<title>py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.</title>
<updated>2015-05-12T21:46:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-05-11T12:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c2a4e4effc81d8ab21bb014e34355643e5ca0da2'/>
<id>urn:sha1:c2a4e4effc81d8ab21bb014e34355643e5ca0da2</id>
<content type='text'>
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
the operator argument.  Hashing for int, str and bytes still go via
fast-path in mp_unary_op since they are the most common objects which
need to be hashed.

This lead to quite a bit of code cleanup, and should be more efficient
if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
x86.

The only loss is that the error message "unhashable type" is now the
more generic "unsupported type for __hash__".
</content>
</entry>
<entry>
<title>py: Some trivial cosmetic changes, for code style consistency.</title>
<updated>2015-04-04T14:53:11+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-04T14:53:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2801e6fad8b8b3ecdd9c8bc58f9515ff66eca46c'/>
<id>urn:sha1:2801e6fad8b8b3ecdd9c8bc58f9515ff66eca46c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Clarify API for map/set lookup when removing&amp;adding at once.</title>
<updated>2015-03-20T17:41:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-03-20T17:41:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d1cee02783666338b526ac686c19440c5f44b258'/>
<id>urn:sha1:d1cee02783666338b526ac686c19440c5f44b258</id>
<content type='text'>
Addresses issue #1160.
</content>
</entry>
<entry>
<title>py: Implement core of OrderedDict type.</title>
<updated>2015-03-20T17:26:10+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-03-17T23:25:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0ef01d0a75b8b2f48a72f0041e048a390b9e75b6'/>
<id>urn:sha1:0ef01d0a75b8b2f48a72f0041e048a390b9e75b6</id>
<content type='text'>
Given that there's already support for "fixed table" maps, which are
essentially ordered maps, the implementation of OrderedDict just extends
"fixed table" maps by adding an "is ordered" flag and add/remove
operations, and reuses 95% of objdict code, just making methods tolerant
to both dict and OrderedDict.

Some things are missing so far, like CPython-compatible repr and comparison.

OrderedDict is Disabled by default; enabled on unix and stmhal ports.
</content>
</entry>
<entry>
<title>py, unix: Allow to compile with -Wsign-compare.</title>
<updated>2015-01-16T17:47:07+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-16T17:47:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=963a5a3e82ded7ee75adae72ae7cb14796fa150e'/>
<id>urn:sha1:963a5a3e82ded7ee75adae72ae7cb14796fa150e</id>
<content type='text'>
See issue #699.
</content>
</entry>
<entry>
<title>py: Move to guarded includes, everywhere in py/ core.</title>
<updated>2015-01-01T20:32:09+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-01-01T20:27:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=51dfcb4bb7613ed164952712d9a5235a7b833cde'/>
<id>urn:sha1:51dfcb4bb7613ed164952712d9a5235a7b833cde</id>
<content type='text'>
Addresses issue #1022.
</content>
</entry>
</feed>
