On 2015-04-23 3:03 AM, Greg Ewing wrote: > Yury Selivanov wrote: >> - If it's an object with __await__, return iter(object.__await__()) > > Is the iter() really needed? Couldn't the contract of > __await__ be that it always returns an iterator? > I wrote it the wrong way. iter() isn't needed, you're right. This is a quote from the ref implementation: if (!PyIter_Check(await_obj)) { PyErr_Format(PyExc_TypeError, "__await__ must return an iterator, %.100s", Py_TYPE(await_obj)->tp_name); Yury
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4