<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objset.c, branch 3.0.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=3.0.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=3.0.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-10-04T01:37:50+00:00</updated>
<entry>
<title>all: Remove inclusion of internal py header files.</title>
<updated>2017-10-04T01:37:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-04T01:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3dc1b1957d2c96d7c60c2c629c95077b03488a1'/>
<id>urn:sha1:a3dc1b1957d2c96d7c60c2c629c95077b03488a1</id>
<content type='text'>
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
</content>
</entry>
<entry>
<title>py/objset: Include the failed key in a KeyError raised from set.remove.</title>
<updated>2017-10-03T07:03:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-03T07:03:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1394258f378e50966daa1d83053067eeee8ef07d'/>
<id>urn:sha1:1394258f378e50966daa1d83053067eeee8ef07d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objset: Check that RHS of a binary op is a set/frozenset.</title>
<updated>2017-10-03T06:56:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-03T06:56:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2ac1364688cd3ee313661e82a336663551986fc8'/>
<id>urn:sha1:2ac1364688cd3ee313661e82a336663551986fc8</id>
<content type='text'>
CPython docs explicitly state that the RHS of a set/frozenset binary op
must be a set to prevent user errors.  It also preserves commutativity of
the ops, eg: "abc" &amp; set() is a TypeError, and so should be set() &amp; "abc".

This change actually decreases unix (x64) code by 160 bytes; it increases
stm32 by 4 bytes and esp8266 by 28 bytes (but previous patch already
introduced a much large saving).
</content>
</entry>
<entry>
<title>py/objset: Simplify set and frozenset by separating their locals dicts.</title>
<updated>2017-10-03T06:55:53+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-03T06:26:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=01978648fdc317c13b17ba186c82df4fb8a5cbac'/>
<id>urn:sha1:01978648fdc317c13b17ba186c82df4fb8a5cbac</id>
<content type='text'>
A lot of set's methods (the mutable ones) are not allowed to operate on a
frozenset, and giving frozenset a separate locals dict with only the
methods that it supports allows to simplify the logic that verifies if
args are a set or a frozenset.  Even though the new frozenset locals dict
is relatively large (88 bytes on 32-bit archs) there is a much bigger
saving coming from the removal of a const string for an error message,
along with the removal of some checks for set or frozenset type.

Changes in code size due to this patch are (for ports that changed at all):

   unix x64:   -56
unix nanbox:  -304
      stm32:   -64
    esp8266:  -124
     cc3200:   -40

Apart from the reduced code, frozenset now has better tab-completion
because it only lists the valid methods.  And the error message for
accessing an invalid method is now more detailed (it includes the
method name that wasn't found).
</content>
</entry>
<entry>
<title>all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate</title>
<updated>2017-08-29T03:16:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-08-29T03:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=58321dd9854d71a96e5db2d361e0efc05d9de8cf'/>
<id>urn:sha1:58321dd9854d71a96e5db2d361e0efc05d9de8cf</id>
<content type='text'>
The unary-op/binary-op enums are already defined, and there are no
arithmetic tricks used with these types, so it makes sense to use the
correct enum type for arguments that take these values.  It also reduces
code size quite a bit for nan-boxing builds.
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py: De-optimise some uses of mp_getiter, so they don't use the C stack.</title>
<updated>2017-02-16T08:11:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-13T04:44:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e6003f466e6f5b7eddd01740666230b62ab5a872'/>
<id>urn:sha1:e6003f466e6f5b7eddd01740666230b62ab5a872</id>
<content type='text'>
In these cases the heap is anyway used to create a new object so no real
need to use the C stack for iterating.  It saves a few bytes of code size.
</content>
</entry>
<entry>
<title>py: Add iter_buf to getiter type method.</title>
<updated>2017-02-16T07:38:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-09T23:14:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ae8d86758631e62466a55d179897d2111c3cb1c1'/>
<id>urn:sha1:ae8d86758631e62466a55d179897d2111c3cb1c1</id>
<content type='text'>
Allows to iterate over the following without allocating on the heap:
- tuple
- list
- string, bytes
- bytearray, array
- dict (not dict.keys, dict.values, dict.items)
- set, frozenset

Allows to call the following without heap memory:
- all, any, min, max, sum

TODO: still need to allocate stack memory in bytecode for iter_buf.
</content>
</entry>
<entry>
<title>py/objset: Convert mp_uint_t to size_t where appropriate.</title>
<updated>2017-02-16T05:51:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-16T05:16:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=68cd3a93f0728b61b0d2407f4ae802806dddce4d'/>
<id>urn:sha1:68cd3a93f0728b61b0d2407f4ae802806dddce4d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objset: Fix inplace binary ops so frozensets are not modified.</title>
<updated>2017-02-02T13:27:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-02-02T13:27:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=2486c4ff469fdb69555476e342eadda91a4ceadf'/>
<id>urn:sha1:2486c4ff469fdb69555476e342eadda91a4ceadf</id>
<content type='text'>
</content>
</entry>
</feed>
