<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/tests/basics/async_for.py, branch main</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=main</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-07-25T05:55:37+00:00</updated>
<entry>
<title>py/compile: Don't await __aiter__ special method in async-for.</title>
<updated>2020-07-25T05:55:37+00:00</updated>
<author>
<name>Jonathan Hogg</name>
<email>me@jonathanhogg.com</email>
</author>
<published>2020-07-21T17:47:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=901f3dce6e5e7c1501550ca0b7f3283848194a2e'/>
<id>urn:sha1:901f3dce6e5e7c1501550ca0b7f3283848194a2e</id>
<content type='text'>
MicroPython's original implementation of __aiter__ was correct for an
earlier (provisional) version of PEP492 (CPython 3.5), where __aiter__ was
an async-def function.  But that changed in the final version of PEP492 (in
CPython 3.5.2) where the function was changed to a normal one.  See
https://www.python.org/dev/peps/pep-0492/#why-aiter-does-not-return-an-awaitable
See also the note at the end of this subsection in the docs:
https://docs.python.org/3.5/reference/datamodel.html#asynchronous-iterators
And for completeness the BPO: https://bugs.python.org/issue27243

To be consistent with the Python spec as it stands today (and now that
PEP492 is final) this commit changes MicroPython's behaviour to match
CPython:  __aiter__ should return an async-iterable object, but is not
itself awaitable.

The relevant tests are updated to match.

See #6267.
</content>
</entry>
<entry>
<title>tests: Add 6 tests for async await/for/with.</title>
<updated>2016-04-13T14:27:06+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-13T14:27:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=c33df193bfbc09dc5c3b62db6507ad1a79e92ea6'/>
<id>urn:sha1:c33df193bfbc09dc5c3b62db6507ad1a79e92ea6</id>
<content type='text'>
</content>
</entry>
</feed>
