4 ms·
In case anyone is stuck on older versions of Python for any reason, here are some backports of some of the listed features: * f-strings: https://github.com/aso
by auscompgeek 7y ago
In case anyone is stuck on older versions of Python for any reason, here are some backports of some of the listed features:
* f-strings: https://github.com/asottile/future-fstrings https://github.com/asottile/future-fstrings (this is a pretty crazy hack, all the way to Python 2)
* pathlib: https://pypi.org/project/pathlib2/ https://pypi.org/project/pathlib2/
* typing: https://pypi.org/project/typing/ https://pypi.org/project/typing/
* enum: https://pypi.org/project/enum34/ https://pypi.org/project/enum34/ (doesn't include any additions in 3.5+)
* functools.lru_cache: https://github.com/jaraco/backports.functools_lru_cache https://github.com/jaraco/backports.functools_lru_cache
* dataclasses: https://github.com/ericvsmith/dataclasses https://github.com/ericvsmith/dataclasses (3.6 only, requires ordered class __annotations__)
I'm half-expecting someone to come along with a hacked-up Python 2 backport for implicit namespace packages :)
- isaacremuant 7y agoWith that in mind, the end for Python 2 is less than 8 months away. Something fun to help people feel the "impending doom" and port their projects: https://pythonclock.org/ https://pythonclock.org/
- kragen 7y agoPython 2 is free software. Nobody and no proper subset of people can unilaterally end it. It ends when people stop using it, writing patches for it, and sharing those patches. There might be a lacuna of coordination when the current maintainers step down in 8 months, but the leftover stubborn Python 2 users will come up with some way to share their patches for, probably, decades.
- anentropic 7y agoI was using enum34... then one day I wanted to use a Flag and found it wasn't in there the same author has another library: https://pypi.org/project/aenum/ https://pypi.org/project/aenum/ which includes the latest enum stuff from 3.5 (plus some other things)