I've been toying around with Python 3 and using it for most of my personal/hack projects, but I somehow missed the unpacking improvements: <a href="https://www.python.org/dev/peps/pep-0448/" rel="nofollow">https://www.python.org/dev/peps/pep-0448/</a><p>In particular, being able to create an updated copy of a dict with a single expression is pretty cool:<p><pre><code> return {**old, 'foo': 'bar'}
# Old way
new = old.copy
new['foo'] = ['bar']
return new</code></pre>
It's so strange to me that data scientists would need to be convinced to move to Python 3. It's superior in every way to legacy Python. I can understand maintaing Python 3 compatbility for legacy systems if you don't want to have Python 3 as a dependancy, but data scientists will be writing mostly ad hoc code and using Jupyter notebooks. The people around me are not allowed to use Python 2, in fact they're generally required to use the latest version of Python 3.<p>For anyone having trouble with maintaing multiple Python versions, I recommend Pyenv. You can install multiple local versions and switch between them. The selected version then uses the standard commands "python" and "pip", etc. which you can use to make your virtualenv from.
I've moved to python 3 over the past couple of months, after resisting for the better part of a decade. I like it.<p>One surprising thing I learned from this document is that dicts now iterate in assignment order, not hash order. That's going to break some code for people.
I’m a little surprised at this point that Apple still doesn’t include a default Python 3.x on macOS. It’s the single thing keeping me from moving (as there’s a big difference between “just run this” and “first download this, then run this”).
I'd been a 2.7 holdout for ages, but when f-strings were greenlit for 3.6, I decided then and there that all my new personal projects would be written in 3.<p>I'm glad I did. F-strings are wonderful, as is pathlib and the enhanced unpacking syntax.<p>Since I started my current job, I've also been writing as many scripts as I can in Python 3 as well (and Docker has been a godsend for that because I can now deploy 3.6 scripts to the few servers we have that are still running RHEL 6).
Several posters indicate that they’ve stuck to python 2.7 even for small side projects until now. I cannot understand why? Python 3 seems to have been technically superior for a few years, and side projects must surely be good for learning something new?
If you would like to write Python 3 but need to maintain support for any particular version of Python 2, something that I can personally recommend is using the Coconut transpiler: <a href="http://coconut-lang.org/" rel="nofollow">http://coconut-lang.org/</a>
The Coconut language is a superset of Python 3, so any valid Python 3 is valid Coconut. But the advantage of the transpiler extends beyond the language itself, in that it can target any version of Python from 2.6 onwards on the Python 2 branch and 3.2 onwards on the Python 3 branch.<p>It has been really useful for me in that I want the advantages of type annotations and f-strings and other python 3.5+ features but I have to support running in an environment with only 2.6 installed. So when I target a 3.5+ version, all of those features are maintained, but when I target 2.6, the transpiler does all the work in converting to running 2.6 code for me.
Didn’t know about the enforce library (<a href="https://github.com/RussBaz/enforce/blob/master/README.md" rel="nofollow">https://github.com/RussBaz/enforce/blob/master/README.md</a>) — but have been wanting something like this.<p>Thanks for the useful list!
Came here to validate my own "I moved" experience: learned stuff I hadn't checked on. TL;DR its never too late to learn what you can do, once you can deprecate the past.
I had so many issues trying to install python3 in an existing server that I ended up having to go back. pip kept complaining and it was just really annoying. Then some libraries were not compatible and it felt like it wasn't worth it.
Is there some kind of slash operator making this statement work? Is this a way to concatenate things?<p>train_path = datasets_root / dataset / 'train'
I realized, just today, that the secrets module is new to 3.6 after trying to pip install it. This being provided directly by the language is a game changer, IMHO.