3 ms·
The punchline: - Python is popular at Facebook - Python 3 is the default for new projects - Changing to Python 3 needed an internal advocate to update build
by xapata 10y ago
The punchline:
- Python is popular at Facebook
- Python 3 is the default for new projects
- Changing to Python 3 needed an internal advocate to update build and dev tools to push the change
- Facebook is a big user of the new ``asyncio`` module
Perhaps the most subtle point of the talk is that Facebook managed to change from 2 to 3 from the efforts of just one person. Of course there were more folks changing code than just the speaker, but it appears he was able to heavily influence the culture change. Enabling 3 for the build tools probably made a big difference.
- makmanalp 10y agoPlus, teaching new hires to use py3 as default, putting in linter warnings to get rid of old bad habits, adding in 2to3 compat layer libraries by default and switching to 3 as default after that seems to have helped.
- Animats 10y agoChanging Python versions is hardly a "culture change". Changing to Go or Rust might be. The main problem is library support, not the language changes. A large company like Facebook can afford to put someone on library compatibility to make this happen.
- xapata 10y agoApparently that wasn't even necessary. The big change for library compatibility was simply changing the settings of the build system. According to the speaker. In my own experience, most libraries are 3-compatible.
- FT_intern 10y agoI used to have issues with machine learning libraries and python 3. Were they fixed recently?
- alextheparrot 10y agoFor the most part new projects have been doing a good job of either working with Python 3 out of the gate or making it a main priority (Issue #1 on Tensorflow was Python 3). In general, you'll be fine with Python 3 now. Some older, academic-type packages are still only Python 2.7 (Though might be easy to port).
- xapata 10y agoFor those still stuck on 2, the most likely culprit is not paying attention to the difference between text and bytes. The required change will be using decode when you want text and encode when you want bytes. Not too much trouble for most projects. But it is a tedious change that cannot always be find-replace'd away.
- sandGorgon 10y agoI'm not sure if you watched the entire video, but I seem to have gotten the impression that all through 2014.. he fixed hundreds of libraries that did not work with Python 3.
- xapata 10y agoI watched it while working on other stuff. Must not have noticed that part. But note that a small company will have correspondingly fewer dependencies. So I'm not sure a small company would need a dedicated upgrade engineer.
- cx1000 10y agoThe size of the company doesn't dictate the number of libraries used. The scope of the work does.