<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objgenerator.c, branch encoding</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=encoding</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=encoding'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-07-24T03:41:10+00:00</updated>
<entry>
<title>remove new char*s because m0 is way oversubscribed</title>
<updated>2020-07-24T03:41:10+00:00</updated>
<author>
<name>Kenny</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-07-22T05:34:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=e9b4e0bd35b6c3024a662580e547df62ab95acd1'/>
<id>urn:sha1:e9b4e0bd35b6c3024a662580e547df62ab95acd1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add coroutine behavior for generators</title>
<updated>2020-07-24T03:40:16+00:00</updated>
<author>
<name>Kenny</name>
<email>3454741+WarriorOfWire@users.noreply.github.com</email>
</author>
<published>2020-07-21T07:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=51a79b1af7fa663bb078136611705c04df12970a'/>
<id>urn:sha1:51a79b1af7fa663bb078136611705c04df12970a</id>
<content type='text'>
coroutines don't have __next__; they also call themselves coroutines.
This does not change the fact that `async def` methods are generators,
but it does make them behave more like CPython.
</content>
</entry>
<entry>
<title>Add license to some obvious files.</title>
<updated>2020-07-06T18:16:25+00:00</updated>
<author>
<name>Diego Elio Pettenò</name>
<email>flameeyes@flameeyes.com</email>
</author>
<published>2020-06-03T22:40:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=34b4993d63a6b576f29d624385c681f679b4124c'/>
<id>urn:sha1:34b4993d63a6b576f29d624385c681f679b4124c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Two fixes and translate more strings.</title>
<updated>2018-08-09T20:29:30+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@tannewt.org</email>
</author>
<published>2018-08-09T01:24:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=96ebf5bc3fb455162286b9bc31e763f3c4f1c457'/>
<id>urn:sha1:96ebf5bc3fb455162286b9bc31e763f3c4f1c457</id>
<content type='text'>
* Fix finding translations with escaped characters.
* Add back \r to translations since its needed by screen.
</content>
</entry>
<entry>
<title>WIP: after merge; before testing</title>
<updated>2018-07-11T20:45:30+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2018-07-11T20:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7c219600a246d8956d0b23ea3f5d125a820e6b6a'/>
<id>urn:sha1:7c219600a246d8956d0b23ea3f5d125a820e6b6a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/objgenerator: Protect against reentering a generator.</title>
<updated>2018-05-22T06:54:03+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-22T06:54:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=400273a799581e5eb86538d8c88fb872705475ab'/>
<id>urn:sha1:400273a799581e5eb86538d8c88fb872705475ab</id>
<content type='text'>
Generators that are already executing cannot be reexecuted.  This patch
puts in a check for such a case.

Thanks to @jepler for finding the bug.
</content>
</entry>
<entry>
<title>py/objgenerator: Save state in old_globals instead of local variable.</title>
<updated>2018-05-22T06:39:19+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-22T06:39:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=771cb359af5242762baa29645c37cafa23c47b25'/>
<id>urn:sha1:771cb359af5242762baa29645c37cafa23c47b25</id>
<content type='text'>
The code_state.old_globals variable is there to save the globals state so
should be used for this purpose, to avoid the need for additional local
variables on the C stack.
</content>
</entry>
<entry>
<title>py/objgenerator: Check stack before resuming a generator.</title>
<updated>2018-04-10T04:06:26+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2018-04-01T17:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cbf981f3307661c205d27f3a418be3989ab47c5e'/>
<id>urn:sha1:cbf981f3307661c205d27f3a418be3989ab47c5e</id>
<content type='text'>
This turns a hard crash in a recursive generator into a 'maximum recursion
depth exceeded' exception.
</content>
</entry>
<entry>
<title>py/objgenerator: Check stack before resuming a generator</title>
<updated>2018-04-01T21:40:15+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2018-04-01T17:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a909007fefbb94ac8de64517a712277cd76e9993'/>
<id>urn:sha1:a909007fefbb94ac8de64517a712277cd76e9993</id>
<content type='text'>
This turns a hard crash in a recursive generator into
a 'maximum recursion depth exceeded' exception.
</content>
</entry>
<entry>
<title>py/objgenerator: Allow to pend an exception for next execution.</title>
<updated>2017-12-15T18:20:36+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-10-21T09:13:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=63644016669c173190c71d39fb33ad9502fe2b0f'/>
<id>urn:sha1:63644016669c173190c71d39fb33ad9502fe2b0f</id>
<content type='text'>
This implements .pend_throw(exc) method, which sets up an exception to be
triggered on the next call to generator's .__next__() or .send() method.
This is unlike .throw(), which immediately starts to execute the generator
to process the exception. This effectively adds Future-like capabilities
to generator protocol (exception will be raised in the future).

The need for such a method arised to implement uasyncio wait_for() function
efficiently (its behavior is clearly "Future" like, and normally would
require to introduce an expensive Future wrapper around all native
couroutines, like upstream asyncio does).

py/objgenerator: pend_throw: Return previous pended value.

This effectively allows to store an additional value (not necessary an
exception) in a coroutine while it's not being executed. uasyncio has
exactly this usecase: to mark a coro waiting in I/O queue (and thus
not executed in the normal scheduling queue), for the purpose of
implementing wait_for() function (cancellation of such waiting coro
by a timeout).
</content>
</entry>
</feed>
