3 ms·
There's good criticism here, but I can't help but feel the rest is mostly Zed flipping out. Regarding 2to3 not being flawless: agree, could be better. Regardi
by hcarvalhoalves 10y ago
There's good criticism here, but I can't help but feel the rest is mostly Zed flipping out.
Regarding 2to3 not being flawless: agree, could be better.
Regarding core libraries: agree, but the same problem exists on Python 2 (different core libraries have different levels of compatibility for taking string or unicode as arguments), so I don't see how this can be a recommendation against 3 specifically.
Regarding new string types and handling, this has been discussed over and over again everywhere on the web, and boils down to people freaking out at unicode by default. This one does a good job explaining everything: http://www.diveintopython3.net/strings.html http://www.diveintopython3.net/strings.html and this one does a good job at showing what you get w/ Py3 (not limited to new string types): https://speakerdeck.com/pyconslides/python-3-dot-3-trust-me-its-better-than-python-2-dot-7-by-dr-brett-cannon https://speakerdeck.com/pyconslides/python-3-dot-3-trust-me-...
Regarding complaints about how many string interpolation methods there are: the `f` method relies on local scope (which is prone to introducing bugs), so it's actually pretty gimmicky compared to `.format` (which takes an explicit data structure as parameter). I would do the opposite and only teach `.format` to beginners since it leads to better code.
Regarding Turing completeness: fun.
- viraptor 10y ago> Regarding 2to3 not being flawless: agree, could be better. The thing to remember though is that 2to3 will never be flawless. Since the underlying representation of some things has been split into different types, it simply impossible to automatically fix some code. For example a function returning the first letter read from a file object is going to be completely different and more explicit in py3 than it was in py2. And the end result it better. You have to fix some code now - tough.