<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/extmod, branch 5.0.0-beta.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-beta.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-12-04T15:29:57+00:00</updated>
<entry>
<title>protocols: Allow them to be (optionally) type-safe</title>
<updated>2019-12-04T15:29:57+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2019-12-03T20:50:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=238e12123690debaf2cf8488fb2a4d4003a06506'/>
<id>urn:sha1:238e12123690debaf2cf8488fb2a4d4003a06506</id>
<content type='text'>
Protocols are nice, but there is no way for C code to verify whether
a type's "protocol" structure actually implements some particular
protocol.  As a result, you can pass an object that implements the
"vfs" protocol to one that expects the "stream" protocol, and the
opposite of awesomeness ensues.

This patch adds an OPTIONAL (but enabled by default) protocol identifier
as the first member of any protocol structure.  This identifier is
simply a unique QSTR chosen by the protocol designer and used by each
protocol implementer.  When checking for protocol support, instead of
just checking whether the object's type has a non-NULL protocol field,
use `mp_proto_get` which implements the protocol check when possible.

The existing protocols are now named:
    protocol_framebuf
    protocol_i2c
    protocol_pin
    protocol_stream
    protocol_spi
    protocol_vfs
(most of these are unused in CP and are just inherited from MP; vfs and
stream are definitely used though)

I did not find any crashing examples, but here's one to give a flavor of what
is improved, using `micropython_coverage`.  Before the change,
the vfs "ioctl" protocol is invoked, and the result is not intelligible
as json (but it could have resulted in a hard fault, potentially):

    &gt;&gt;&gt; import uos, ujson
    &gt;&gt;&gt; u = uos.VfsPosix('/tmp')
    &gt;&gt;&gt; ujson.load(u)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    ValueError: syntax error in JSON

After the change, the vfs object is correctly detected as not supporting
the stream protocol:
    &gt;&gt;&gt; ujson.load(p)
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    OSError: stream operation not supported
</content>
</entry>
<entry>
<title>Move font dependency to extmod from stm32</title>
<updated>2019-10-13T23:33:03+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-10-13T23:10:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e89bcce7112a8ec70bd3f9d4f4097d1e7320ddde'/>
<id>urn:sha1:e89bcce7112a8ec70bd3f9d4f4097d1e7320ddde</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Prevent other filesystem changes besides file writes</title>
<updated>2019-03-13T23:10:53+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-03-13T22:17:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6c01aba05b12c1f078197a45a711bcc5092b2a1c'/>
<id>urn:sha1:6c01aba05b12c1f078197a45a711bcc5092b2a1c</id>
<content type='text'>
Such as moving files, adding directories and changing the label.
</content>
</entry>
<entry>
<title>Throw an error when moving a directory into itself.</title>
<updated>2019-03-13T23:10:52+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-03-13T22:07:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7482870164d614adb3de99f68d04535c3f035923'/>
<id>urn:sha1:7482870164d614adb3de99f68d04535c3f035923</id>
<content type='text'>
Fixes #1192
</content>
</entry>
<entry>
<title>Merge pull request #1584 from tannewt/disable_concurrent_write_protection</title>
<updated>2019-02-21T22:15:50+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T22:15:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d218069f03451e74e049b337830cbd1be7a25d8e'/>
<id>urn:sha1:d218069f03451e74e049b337830cbd1be7a25d8e</id>
<content type='text'>
Add option to disable the concurrent write protection</content>
</entry>
<entry>
<title>Merge pull request #1582 from dhalbert/remove-u-names</title>
<updated>2019-02-21T21:24:07+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-02-21T21:24:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=0261c57d32310a0c14703de3c197b700f9f401c3'/>
<id>urn:sha1:0261c57d32310a0c14703de3c197b700f9f401c3</id>
<content type='text'>
rename ure, ujson, and uerrno to re, json, and errno</content>
</entry>
<entry>
<title>conditionalize re object type name</title>
<updated>2019-02-21T20:11:54+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T20:11:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=01e5a82f1c157c4e170fec4b1e9d1bd1156e97fe'/>
<id>urn:sha1:01e5a82f1c157c4e170fec4b1e9d1bd1156e97fe</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add option to disable the concurrent write protection</title>
<updated>2019-02-21T18:45:41+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2019-02-19T22:45:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1a0596a2fbb68c1285ec59606d03a610ee94ca47'/>
<id>urn:sha1:1a0596a2fbb68c1285ec59606d03a610ee94ca47</id>
<content type='text'>
This allows writing to the filesystem from the host computer and
CircuitPython by increasing the risk of filesystem corruption.
</content>
</entry>
<entry>
<title>Add CIRCUITPY macro; rename u* only when CIRCUITPY=1</title>
<updated>2019-02-21T16:09:44+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T16:09:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=10d3a20f8a639ad8ef5555e2142052190e8a7e13'/>
<id>urn:sha1:10d3a20f8a639ad8ef5555e2142052190e8a7e13</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename ure, ujson, and uerrno to re, json, and errno</title>
<updated>2019-02-21T05:33:36+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-02-21T05:33:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c5dbdbe88c099494cd14790b8c645020538eed27'/>
<id>urn:sha1:c5dbdbe88c099494cd14790b8c645020538eed27</id>
<content type='text'>
</content>
</entry>
</feed>
