<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py, branch 5.1.x</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.1.x</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.1.x'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-03-17T14:33:17+00:00</updated>
<entry>
<title>ulab: include new 'extras' source file</title>
<updated>2020-03-17T14:33:17+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-17T14:33:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96f2288b8403073075267bc058abca0a01606b80'/>
<id>urn:sha1:96f2288b8403073075267bc058abca0a01606b80</id>
<content type='text'>
</content>
</entry>
<entry>
<title>ulab: rename enable macro so it appears in the support matrix</title>
<updated>2020-03-17T14:33:03+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-17T14:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d6342af98014c0cc9e3c6b3010f06db88aa470b2'/>
<id>urn:sha1:d6342af98014c0cc9e3c6b3010f06db88aa470b2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>objslice: take mp_obj_slice_indices from micropython</title>
<updated>2020-03-17T13:32:52+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-17T01:59:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=69aa010cfc3c67a5cf07b356b55eec964f896ac5'/>
<id>urn:sha1:69aa010cfc3c67a5cf07b356b55eec964f896ac5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Merge pull request #2690 from jepler/topic-pep-498-fstrings</title>
<updated>2020-03-10T17:53:04+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2020-03-10T17:53:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=d988af02d13a24d2b2b62d2c64d053c3b089caea'/>
<id>urn:sha1:d988af02d13a24d2b2b62d2c64d053c3b089caea</id>
<content type='text'>
Implement partial PEP-498 (f-string) support </content>
</entry>
<entry>
<title>circuitpy_mpconfig.mk: Enable ULAB for "full builds"</title>
<updated>2020-03-09T20:54:40+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-09T20:54:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=491a31a7312d21cd7ead17d158971572f5372335'/>
<id>urn:sha1:491a31a7312d21cd7ead17d158971572f5372335</id>
<content type='text'>
This enables it on the imxrt and cds56 ports where it was disabled before
</content>
</entry>
<entry>
<title>f-strings: Make optional, defaulting to !CIRCUITPY_MINIMAL_BUILD</title>
<updated>2020-03-09T14:03:25+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-09T14:02:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=473e9c5ffb081ae2750948099ac8288b039d4255'/>
<id>urn:sha1:473e9c5ffb081ae2750948099ac8288b039d4255</id>
<content type='text'>
This should reclaim *most* code space added to handle f-strings.
However, there may be some small code growth as parse_string_literal
takes a new parameter (which will always be 0, so hopefully the optimizer
eliminates it)
</content>
</entry>
<entry>
<title>lexer: catch concatenation of f'' and '' strings</title>
<updated>2020-03-09T14:03:25+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-03-09T13:33:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=32647cd9b41c26003df0bdc385353f6a24b727d7'/>
<id>urn:sha1:32647cd9b41c26003df0bdc385353f6a24b727d7</id>
<content type='text'>
This turns the "edge case" into a parse-time error.
</content>
</entry>
<entry>
<title>Address dpgeorge feedback - largely simplifications</title>
<updated>2020-03-09T13:16:07+00:00</updated>
<author>
<name>Josh Klar</name>
<email>josh@klar.sh</email>
</author>
<published>2019-09-26T23:48:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=40bc05ee1eafcc2f0b3ed48f212a1526b65163bc'/>
<id>urn:sha1:40bc05ee1eafcc2f0b3ed48f212a1526b65163bc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Implement partial PEP-498 (f-string) support</title>
<updated>2020-03-09T13:16:07+00:00</updated>
<author>
<name>Josh Klar</name>
<email>josh@klar.sh</email>
</author>
<published>2019-08-11T04:27:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3a7a5ba6860c787cc691b5c828eff9a130f39526'/>
<id>urn:sha1:3a7a5ba6860c787cc691b5c828eff9a130f39526</id>
<content type='text'>
This implements (most of) the PEP-498 spec for f-strings, with two
exceptions:

- raw f-strings (`fr` or `rf` prefixes) raise `NotImplementedError`
- one special corner case does not function as specified in the PEP
(more on that in a moment)

This is implemented in the core as a syntax translation, brute-forcing
all f-strings to run through `String.format`. For example, the statement
`x='world'; print(f'hello {x}')` gets translated *at a syntax level*
(injected into the lexer) to `x='world'; print('hello {}'.format(x))`.
While this may lead to weird column results in tracebacks, it seemed
like the fastest, most efficient, and *likely* most RAM-friendly option,
despite being implemented under the hood with a completely separate
`vstr_t`.

Since [string concatenation of adjacent literals is implemented in the
lexer](https://github.com/micropython/micropython/commit/534b7c368dc2af7720f3aaed0c936ef46d773957),
two side effects emerge:

- All strings with at least one f-string portion are concatenated into a
single literal which *must* be run through `String.format()` wholesale,
and:
- Concatenation of a raw string with interpolation characters with an
f-string will cause `IndexError`/`KeyError`, which is both different
from CPython *and* different from the corner case mentioned in the PEP
(which gave an example of the following:)

```python
x = 10
y = 'hi'
assert ('a' 'b' f'{x}' '{c}' f'str&lt;{y:^4}&gt;' 'd' 'e') == 'ab10{c}str&lt; hi &gt;de'
```

The above-linked commit detailed a pretty solid case for leaving string
concatenation in the lexer rather than putting it in the parser, and
undoing that decision would likely be disproportionately costly on
resources for the sake of a probably-low-impact corner case. An
alternative to become complaint with this corner case of the PEP would
be to revert to string concatenation in the parser *only when an
f-string is part of concatenation*, though I've done no investigation on
the difficulty or costs of doing this.

A decent set of tests is included. I've manually tested this on the
`unix` port on Linux and on a Feather M4 Express (`atmel-samd`) and
things seem sane.
</content>
</entry>
<entry>
<title>Merge pull request #2657 from tannewt/builtin_package</title>
<updated>2020-03-05T20:28:46+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jeff@adafruit.com</email>
</author>
<published>2020-03-05T20:28:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=4fa90261a37f0f729b52289cf54492ec7108e16b'/>
<id>urn:sha1:4fa90261a37f0f729b52289cf54492ec7108e16b</id>
<content type='text'>
Support importing native modules in native packages.</content>
</entry>
</feed>
