syrusakbary / promise

Ultra-performant Promise implementation in Python
MIT License
362 stars 76 forks source link

Python 2.7 issue #16

Open MagnusSjoberg opened 8 years ago

MagnusSjoberg commented 8 years ago

In iterate_promise.py a python 3 construct is used: yield from This prevents correct installs on i.e. CentOS which uses python 2.7.9 Would it be possible to change to using a 2.7 friendly construct like: for foo in promise.future: yield foo since there are no advanced (python >= 3) uses of yield?

boneill42 commented 7 years ago

Will this be merged to master? (and available in >2.0.1?)

syrusakbary commented 7 years ago

Nope, this is not added into the core. The yield from x syntax is not equivalent to for i in x: yield i, and have some performance repercussions.

http://stackoverflow.com/questions/17581332/converting-yield-from-statement-to-python-2-7-code

However this file is not required and the import is already covered by an ImportError or SyntaxError catch.

I think this just prints a warning once the package is installed, but doesn't prevent the install on any machine, is that right?

LivInTheLookingGlass commented 7 years ago

No, I had it fail to install on a couple machines. I found it really difficult to replicate the issue, though, which is why I closed #19

LivInTheLookingGlass commented 7 years ago

This may help:

https://pypi.python.org/pypi/yieldfrom/1.0.0