Re:PySolFC – A collection of Solitaire games for Python
by xapata on Friday April 07, 2017 @11:37AM
(#14060566)
I've been using 3.6 for some personal work and man are f-strings and ordered dicts wonderful. I don't want to go back.
[ Parent
| on HN ]
Re:PySolFC – A collection of Solitaire games for Python
by renesd on Friday April 07, 2017 @12:15PM
(#14060933)
1_000_000 times this.
Re:PySolFC – A collection of Solitaire games for Python
by TylerE on Friday April 07, 2017 @12:43PM
(#14061256)
OrderedDict is just a stdlib import away in Py2.7.
Re:PySolFC – A collection of Solitaire games for Python
by xapata on Friday April 07, 2017 @01:39PM
(#14061789)
Yeah, but... those are ugly. ``m = {}`` is beautiful.
Re:PySolFC – A collection of Solitaire games for Python
by Macha on Friday April 07, 2017 @01:45PM
(#14061849)
dict == OrderedDict is a cpython implementation detail. Not doing the import is just leaving a footgun for yourself if you ever decide to try PyPy or VOC or similar.
Re:PySolFC – A collection of Solitaire games for Python
by rspeer on Friday April 07, 2017 @02:50PM
(#14062460)
I don't think it's much of a footgun, and I don't think it's limited to CPython.
In Python 3.6, kwargs are ordered. In all versions of Python, kwargs are a dict. Therefore, in any implementation of Python 3.6, dicts are ordered.
The dev team has stopped short of promising that dicts are ordered, but I can't see how one would realistically be harmed by assuming it to be true.