Python 3 angst 2016 edition



  • I woke up to well known tech pundits yelling at each other over Python 3.

    Step 1: Zed Shaw (Learn Python The Hard Way) sticks it in with an updated list of reasons not to adopt Python 3

    IMO, most of his reasons are frankly terrible. And what's with the whole conspiracy angle? The guy seriously thinks Py3 designers are some kind of a nefarious cabal trying "trick" people into using their language. Ummm... that's... kind of what every language designer is trying to do, Zed.

    Step 2: Eevee of the PHP: Fractal of bad design fame shoots back with an excellent rebutal.

    IMO this addresses Zed's "concerns" pretty well.

    Step 3: Yehuda Katz, a big name in js and ruby (ember.js, yarn) pipes in. And he is on Zed's side.

    Step 4: Eevee and Katz are now snipping at each other on twitter.

    Just follow the previous two twitter threads, they converge.

    Zed hasn't jumped into the fray on twitter so far. Boy, I hope he does.

    :popcorn:


  • Discourse touched me in a no-no place

    @cartman82 It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system. If you do, everything just gets very upset. (For the record, I've got about 4 or 5 different builds of Python on this system, and not one of them has all interesting libraries supported at once. :face_palm:) This means that you're forced into all sorts of weird stuff to try to keep old production applications going while supporting transitioning to newer versions, and that's annoying for ordinary users: they just want the basic stuff to Just Work™ so they can get on and write the code that they actually care about.

    Zed's perspective is useful precisely because it is from the perspective of a more ordinary user and from the perspective of someone who does training and education of ordinary users. Stop screwing people over, Python devs, and just provide a stable and consistent language interface that is well-taught and explained.



  • @dkf said in Python 3 angst 2016 edition:

    @cartman82 It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system. If you do, everything just gets very upset. (For the record, I've got about 4 or 5 different builds of Python on this system, and not one of them has all interesting libraries supported at once. ) This means that you're forced into all sorts of weird stuff to try to keep old production applications going while supporting transitioning to newer versions, and that's annoying for ordinary users: they just want the basic stuff to Just Work™ so they can get on and write the code that they actually care about.

    I don't have nearly as much experience, but isn't that solved with virtualenv setups?

    For example, my home project comes with its own python interpreter and an entire pip database of modules configured for its session (through PATH). Second project can have its own bundle, etc. And they all work side-by-side. The only potential issue are native linux libs, but so far, I haven't seen it in practice.

    What am I missing?


  • Discourse touched me in a no-no place

    @cartman82 said in Python 3 angst 2016 edition:

    I don't have nearly as much experience, but isn't that solved with virtualenv setups?

    No idea, but somehow several different pieces of package installation software have managed to make me have a machine where I cannot find a way to use both NumPy and SciPy at once.


  • Grade A Premium Asshole

    @dkf said in Python 3 angst 2016 edition:

    It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system.

    Gentoo Linux seems to handle it just fine.

    $ python --version
    Python 3.4.3
    $ python2 --version
    Python 2.7.11
    $ python3 --version
    Python 3.4.3
    $ eselect python list
    Available Python interpreters, in order of preference:
      [1]   python3.4
      [2]   python2.7 (fallback)
    

    You can also change whether Python2 or Python3 is the default when you just ask for "python".

    Now, Gentoo only supports having one version of Python from each minor release (2.7, 3.4, 3.5) simultaneously installed on the system, so your "four or five different builds" situation wouldn't be supported. But, I would bet that that's not a terribly big concern for most folks who're using Python. ;)



  • @dkf Not sure about the how, but the package manager seems to handle that on my machine. I can use things like numpy and matplotlib from both the python2 (2.7) and python3 (3.4) interpreters. :shrug:



  • @cartman82

    The Python project's efforts to convince you to start with Python 3 are not in your best interest, but, rather, are only in the best interests of the Python project.

    Good start. It's in my best interest to use a programming language that the maintainers can actually maintain and improve.

    You Should Be Able to Run 2 and 3

    In the programming language theory there is this basic requirement that, given a "complete" programming language, I can run any other programming language. In the world of Java I'm able to run Ruby, Java, C++, C, and Lua all at the same time. In the world of Microsoft I can run F#, C#, C++, and Python all at the same time. This isn't just a theoretical thing. There is solid math behind it. Math that is truly the foundation of computer science.

    Oh lord this man is mixing things up. Yes, the Church–Turing thesis says that you can run Ruby inside Java, C inside Ruby, Lua inside C, and Python2 inside Python3, but that's completely unrelated to running different programs/interpreters directly on the machine that can talk to each other, which is what you actually do 99% of the time you run stuff.

    However I agree with his conclusion that you should be able to run Python2 and Python3, as I've said before interoperability is the key in successful migrations, asking people to migrate their entire codebase at once is crazy.

    Let me skip down the article a bit...

    0_1479985913289_upload-bc68fb9f-c000-4cfb-a8ba-fb518b96308d

    http://www.thedailycrate.com/wp-content/uploads/2014/01/Blog-Picard-Irritated-01.jpg

    http://www.thedailycrate.com/wp-content/uploads/2014/01/Blog-Picard-Irritated-04.jpg



  • @cartman82 said in Python 3 angst 2016 edition:

    Zed Shaw

    Haven't we already established before that this guy doesn't know what he's talking about?



  • @dkf said in Python 3 angst 2016 edition:

    @cartman82 It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system.

    Isn't this the issue with nearly all open source languages. Maintaining an environment of open source software is is like trying to fit together a box of broken glass shards back into a window pane.


  • sockdevs

    @Helix said in Python 3 angst 2016 edition:

    Isn't this the issue with nearly all open source languages

    Not with NodeJS. Just install nvm, and you can have as many versions as you like side-by-side! Even point releases!


  • area_can

    That doesn't mean the game is over, but 1/

    I don't think his assertion that 1/ really makes sense without any support for it :/

    Filed under: why the fuck are you people using Twitter



  • @bb36e Also, this. When you need to use 10 twitters to get your message across, maybe, just maybe, twitter isn't the medium you're supposed to use. Assuming that twitter is ever the medium you're supposed to use, which I guess is debatable.


  • Discourse touched me in a no-no place

    @Helix said in Python 3 angst 2016 edition:

    Isn't this the issue with nearly all open source languages.

    Nearly all ≠ all.


  • Notification Spam Recipient

    @RaceProUK said in Python 3 angst 2016 edition:

    @Helix said in Python 3 angst 2016 edition:

    Isn't this the issue with nearly all open source languages

    Not with NodeJS. Just install nvm, and you can have as many versions as you like side-by-side! Even point releases!

    I manage to have multiple versions of node installed side by side simply by getting the binary packages and unpacking them in my home directory, then having PATH include ~/nodejs/bin, where nodejs is a symlink to the version of node I want to use.

    I'm not sure how someone manages to write a 3000 line shell script with a dependency on a C++ compiler to do the same thing



  • @cark said in Python 3 angst 2016 edition:

    I manage to have multiple versions of node installed side by side simply by getting the binary packages and unpacking them in my home directory, then having PATH include ~/nodejs/bin, where nodejs is a symlink to the version of node I want to use.
    I'm not sure how someone manages to write a 3000 line shell script with a dependency on a C++ compiler to do the same thing

    I did exactly the same thing.

    Call a tiny bash script with version number and prefix, it downloads the gzip, unpacks it and links the binaries. Done in 15 seconds.

    nvm always had a stench about it that made me steer clear.


  • Notification Spam Recipient

    @dkf said in Python 3 angst 2016 edition:

    It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system. If you do, everything just gets very upset.

    I'm pretty sure every system I've managed in the last 3 or 5 years has had both python 2 and 3 installed, with no problems whatsoever. You're either using a really shitty distribution, or not using the distribution supplied packages, which is probably the wrong choice. There is no reason for this to be a problem



  • @Helix I think interoperability is a problem with languages in general. Calling a function written in language X from language Y is generally a chore, when 90% of the time it should be relatively straightforward.

    Someone ought to invent some sort of Common Language Infrastructure to fix it.



  • @anonymous234 said in Python 3 angst 2016 edition:

    Someone ought to invent some sort of Common Language Infrastructure to fix it.

    yeah, we could use xml to define the interfaces



  • @cark said in Python 3 angst 2016 edition:

    I'm not sure how someone manages to write a 3000 line shell script with a dependency on a C++ compiler to do the same thing

    I'm probably misunderstanding, but isn't using different versions of gcc (or g++) trivial? Using the same symlink solution that you're describing or any other way, it works like a charm.

    (OK, if you want to use different versions of the libc it's slightly more tricky as you may have to tweak the LD_LIBRARY_PATH as well, but that's all)



  • @Helix said in Python 3 angst 2016 edition:

    @dkf said in Python 3 angst 2016 edition:

    @cartman82 It seems to me like the really big problems relate to how hard it is to have both Python 2 and Python 3 installed on the same system.

    Isn't this the issue with nearly all open source languages. Maintaining an environment of open source software is is like trying to fit together a box of broken glass shards back into a window pane.

    'nearly all' is basically my experience with ruby and python, both of which makes me want to smash every window in sight.


  • area_pol

    It is not the first time that Zed Shaw's ridiculous behaviour is ridiculed on our forum, last time:
    https://what.thedailywtf.com/topic/16422/zed-shaw-gets-schooled-on-c-undefined-behavior

    From the post, I understand that "Shaw does not like Python 3", but what does he propose instead?

    It's my hope that this essay wakes them up and they change their path to something much more friendly to everyone. That they admit Python 3's design was seriously flawed and start Python 4 in an attempt to rescue the language.

    Conveniently lacking any proposals of what that direction could be.
    If there is ever a Python 4, I am sure there will be a "Case against Python 4" article by Zed Shaw.

    2to3 translator

    Admittedly this could have been done in a better way. Eevee is right that in general this is a difficult problem to translate between languages A and B.
    However, the Python devs control the design of language B, so they could design it in a way that improves chances of translation.
    Maybe they tried and deemed it not worth the effort. Or python code is just not very good at preserving precise logical information - which is highly likely given lack of static typing.


  • sockdevs


  • Winner of the 2016 Presidential Election

    @bugmenot said in Python 3 angst 2016 edition:

    Now, Gentoo only supports having one version of Python from each minor release (2.7, 3.4, 3.5) simultaneously installed on the system, so your "four or five different builds" situation wouldn't be supported.

    If you need another minor version:

    1. Install into /usr/local/
    2. Create virtualenv
    3. ???
    4. Profit

  • mod

    I'm sorry, what the actual fuck is Zed Shaw talking about?! That's not how ANYTHING works!? And has he never heard of Hanlon's Razor?

    Oh, wait, this is the blowhard who puts big red scare boxes at the top of exercises to say things like

    If you skipped Exercise 0 then you are not doing this book right. You must read every single thing I write here and read it carefully.

    Fuck you dude.


  • mod

    @RaceProUK said in Python 3 angst 2016 edition:

    . Just install nvm,

    In Python world it's called PyEnv IIRC



  • Zed Shaw shoots back


  • Winner of the 2016 Presidential Election

    @cartman82 said in Python 3 angst 2016 edition:

    Zed Shaw shoots back

    Bah, level of vitriol is lower than expected.

    I wanted to say we should get him here for some flamewars. Now I think he might've gone too soft to provide the kind of entertainment I was hoping for...



  • @cartman82 said in Python 3 angst 2016 edition:

    Eevee and Katz are now snipping at each other on twitter.
    Zed hasn't jumped into the fray on twitter so far. Boy, I hope he does.

    So this is basically the programmer's version of "Jersey Shore".



  • @Yamikuronue

    What's the difference between pyenv, pyvenv, venv, and virtualenv?

    pyenv - a 3rd party tool for switching between multiple versions of Python (e.g. change the global Python version between Python 2 and 3).

    pyvenv - a built-in command line tool for creating “virtual environments”. It helps separate packages dependence between projects. Added since Python 3.3.

    venv - a built-in API module for creating "virtual environments". Added since Python 3.3.

    virtualenv -a 3rd party tool for creating "virtual environments".

    So yes,

    • pyenv ≅ nvm
    • pyvenv/venv and virtualenv ≅ npm install (without -g), if it also copied the nodejs executable to the current directory
    • pyvenv is deprecated in favor of venv (used through python -m venv)

  • area_pol

    @cartman82 He keeps ranting how Python 3 is difficult for beginners.
    But after all the differences between Python versions are small (order of magnitude smaller than Python vs other language), and beginners (or any reasonable people) will not care of even not notice them unless specifically paying attention.


  • sockdevs

    @Adynathos yup, basically he's complaining that 'it's too difficult for him to adapt'.



  • @Yamikuronue said in Python 3 angst 2016 edition:

    I'm sorry, what the actual fuck is Zed Shaw talking about?! That's not how ANYTHING works!? And has he never heard of Hanlon's Razor?

    Oh, wait, this is the blowhard who puts big red scare boxes at the top of exercises to say things like

    If you skipped Exercise 0 then you are not doing this book right. You must read every single thing I write here and read it carefully.

    Fuck you dude.

    He also likes to say things like, Don't worry about how it works; just make your code look exactly like mine. That's not teaching programmers; that's training code monkeys.



  • @Adynathos said in Python 3 angst 2016 edition:

    @cartman82 He keeps ranting how Python 3 is difficult for beginners.
    But after all the differences between Python versions are small (order of magnitude smaller than Python vs other language), and beginners (or any reasonable people) will not care of even not notice them unless specifically paying attention.

    Agreed. Python 3 is fine. Nothing he whines about is in any way relevant to beginners. Maybe 8 years ago, but not today.



  • @cartman82 What's the HN he keeps talking about?


  • sockdevs


  • sockdevs

    @cartman82 8 years ago... when Python 3 first came out?



  • @HardwareGeek said in Python 3 angst 2016 edition:

    He also likes to say things like, Don't worry about how it works; just make your code look exactly like mine. That's not teaching programmers; that's training code monkeys.

    That's one of the things I like about his books, actually.

    He's always trying to motivate you to type code, get things working right away, worry about details later. He's more like a fitness trainer than a college professor.

    Not sure this is the correct approach, but I find myself way more engaged with his material than just passively reading coding theory.



  • @Arantor said in Python 3 angst 2016 edition:

    @cartman82 8 years ago... when Python 3 first came out?

    I presume. No one seems to like 3.0 and 3.1. I have no opinion, I got in somewhere around 3.4, and it was fine then.



  • @Arantor Thanks. I know I could have Googled it and guessed but I wanted to be sure.



  • @coldandtired said in Python 3 angst 2016 edition:

    @Arantor Thanks. I know I could have Googled it and guessed but I wanted to be sure.

    Save your google tokens for when it matters.



  • 0_1480021755491_upload-67f317c5-cb31-4b6e-8e2b-324244813253

    Ah, the good ol "I was just trolling hahaha I'm not an idiot that you thought I was" gambit.


  • Grade A Premium Asshole


  • area_pol

    0_1480021755491_upload-67f317c5-cb31-4b6e-8e2b-324244813253

    And people call him out on his bullshit ... because they are "too stupid".
    Zed Shaw's strategy is to meet everyone and everything with condescension, which is also visible in those red boxes in his tutorial.


  • Grade A Premium Asshole

    @asdf said in Python 3 angst 2016 edition:

    If you need another minor version:

    1. Install into /usr/local/
    2. Create virtualenv
    3. ???
    4. Profit

    Oh sure, no doubt. Maybe I should have said something like "won't be supported by eselect", or "won't even be noticed by the package manager, so you'll (probably?) need to manually install Python packages you installed with the package manager"? I didn't mean to say that there was no way to install another version.

    Of (minor?) note is the fact that Gentoo doesn't use virtualenv (or any of those other things that Zecc mentioned) to handle the concurrently installed versions.



  • @Zecc said in Python 3 angst 2016 edition:

    @Yamikuronue

    What's the difference between pyenv, pyvenv, venv, and virtualenv?

    pyenv - a 3rd party tool for switching between multiple versions of Python (e.g. change the global Python version between Python 2 and 3).

    pyvenv - a built-in command line tool for creating “virtual environments”. It helps separate packages dependence between projects. Added since Python 3.3.

    venv - a built-in API module for creating "virtual environments". Added since Python 3.3.

    virtualenv -a 3rd party tool for creating "virtual environments".

    So yes,

    • pyenv ≅ nvm
    • pyvenv/venv and virtualenv ≅ npm install (without -g), if it also copied the nodejs executable to the current directory
    • pyvenv is deprecated in favor of venv (used through python -m venv)

    I think the fact that these all exist and are or were necessary is some point is
    THIS
    huge of a :wtf: .



  • @bugmenot said in Python 3 angst 2016 edition:

    Gentoo Linux seems to handle it just fine.

    Much the same for OS X/macOS, using a different way:

    $ ls -l /usr/bin/python*
    -rwxr-xr-x  1 root  wheel  66848 14 sep 02:56 /usr/bin/python
    -rwxr-xr-x  5 root  wheel    925 31 jul 03:36 /usr/bin/python-config
    lrwxr-xr-x  1 root  wheel     75  6 nov 16:14 /usr/bin/python2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
    lrwxr-xr-x  1 root  wheel     82  6 nov 16:14 /usr/bin/python2.6-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6-config
    lrwxr-xr-x  1 root  wheel     75  6 nov 16:14 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
    lrwxr-xr-x  1 root  wheel     82  6 nov 16:14 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    -rwxr-xr-x  1 root  wheel  66848 14 sep 02:57 /usr/bin/pythonw
    lrwxr-xr-x  1 root  wheel     76  6 nov 16:14 /usr/bin/pythonw2.6 -> ../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/pythonw2.6
    lrwxr-xr-x  1 root  wheel     76  6 nov 16:14 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7
    

    No idea how they handle different versions of libraries, though, since I’ve never tried tinkering with that. As far as I’m concerned, the :wtf: here is mainly that Apple for some reason provides only versions that are years behind the current release:

    $ python --version
    Python 3.0.1
    

    This on the most recent macOS 10.12.1 :/


  • Discourse touched me in a no-no place

    @Gurth said in Python 3 angst 2016 edition:

    No idea how they handle different versions of libraries, though

    Badly.


  • sockdevs

    @Yamikuronue said in Python 3 angst 2016 edition:

    @RaceProUK said in Python 3 angst 2016 edition:

    . Just install nvm,

    In Python world it's called PyEnv IIRC

    /me makes a note of that

    /me has been dabbling a little in the sea of Python recently


  • Dupa

    @RaceProUK said in Python 3 angst 2016 edition:

    @Helix said in Python 3 angst 2016 edition:

    Isn't this the issue with nearly all open source languages

    Not with NodeJS. Just install nvm, and you can have as many versions as you like side-by-side! Even point releases!

    But then you have to deal with NodeJS and that might make you kill yourself.



  • For what's it worth, while I sometimes like to tinker with python3 for personal projects and for the most part like it better than python2, I still use python2 where it matters - simply because it would be too needlessly time-consuming to switch at this point and the benefit is pretty minor.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.