Live data from Hacker News

Python 2.x vs 3.x use survey

surveymonkey.com

81–90 of 119 posts

Re: Python 2.x vs 3.x use survey

#81
post #67

Earlier quoted context omitted.

The Python interactive shell could check the user's input: If it'll take infinitely long to run (e.g., an infinite generator), then it'll halt. If the code will eventually return, then it'll be run, displaying results to the user. Seems simple enough, no?

You'll need some killer heurstics: https://en.wikipedia.org/wiki/Halting_Problem

Er, I sorta knew that I was describing the halting problem, and was wondering if someone would fail to realize my sarcasm...

Re: Python 2.x vs 3.x use survey

#82

Dear Apple. Please include python 3 as /usr/bin/python3 in all future Releases. And Microsoft, if you're listening, it would be extremely sweet if you would install python by default as well...

Microsoft would prefer you to use PowerShell and Visual Studio. Python wasn't invented in Redmond.

If anything, they would package IronPython - which wouldn't go over to well with people expecting C-extensions to work.

Re: Python 2.x vs 3.x use survey

#83
post #60

Earlier quoted context omitted.

one single dependency that doesn't support py3 is the death knell to using it for anything, EVER Can't you logically extend that across language boundaries, and if so, why would you ever try to use a different language? A needed library or feature of a library might be missing. Is it really that hard to take whatever dependency isn't supported and patch it? Isn't that one of the benefits of running an interpreted lan…

No, if it is a library, that you use all over your code. And you will not risk that your project fails, just because somebody wants to use only the newest stuff. Nobody in a time critical project (when it is not?), will switch from Py2 to Py3 just because it is the most recent version of Python and replace at least one library that is written in C and does not work in Py3. Either you have to replace the whole lib or…

But the GP comment wasn't just addressing porting projects (which I would understand), it was "one single dependency that doesn't support py3 is the death knell to using it for anything, EVER" (emphasis theirs).

That's a fairly strong opinion to take, and in my opinion, goes far enough to be ridiculous.

Re: Python 2.x vs 3.x use survey

#84
post #17

The biggest thing that drives me nuts about py3 is just that its repl doesn't evaluate generators. I'm sure they had their reasons, but I use python as my go-to calculator, and when simple operations with maps/ranges give me a representation of a generator ("<map object at ...", whatever), then it's just less useful to me. I could be alone in that use case though...

> The biggest thing that drives me nuts about py3 is just that its repl doesn't evaluate generators. If by evaluate you mean "convert to a list", that's sensible, since a generator may or may not be safe to convert to a list. If you want a list, wrap the generator to a call to the list() builtin function, and, voila.

This. Not all generators can be converted to a list in a timely manner, seeing as infinite generators are supported.

Re: Python 2.x vs 3.x use survey

#86
post #17

The biggest thing that drives me nuts about py3 is just that its repl doesn't evaluate generators. I'm sure they had their reasons, but I use python as my go-to calculator, and when simple operations with maps/ranges give me a representation of a generator ("<map object at ...", whatever), then it's just less useful to me. I could be alone in that use case though...

It's really only a solution if the calculator usage is on a small number of computers, but you can just import * an override of the map function that behaves however you want. The override is easy: pymap=map def map(...)... (and maybe for calculator style usage you would name your list returning map and range m and r, which would also help with not confusing them with the usual behavior)

You don't even have to do the assignment at the begging of your snippet. You could just refer to the builtin module explicitly.

Re: Python 2.x vs 3.x use survey

#87
post #80
post #11

For Mercurial, this is the biggest problem with Python 3: http://bugs.python.org/issue3982 They got rid of format for ordinary strings, and since we have to use bytestrings for handling hg's binary format, converting back and forth with .decode and .encode just to get the formatting is a lot of work. The Python devs have actually acknowledged this use case and apologised to hg. Kinda weird, considering how Python its…

Why not write it yourself, as a utility method rather than something built-in? Granted it would be nice to be built in, but that shouldn't stop anyone. Or is there some other reason?

Speed is another big concern. You want your DVCS to be as fast as possible. You don't want to wait even half a second to see the output of "hg status" just to see which files you've modified.

Re: Python 2.x vs 3.x use survey

#88
post #67

Earlier quoted context omitted.

The Python interactive shell could check the user's input: If it'll take infinitely long to run (e.g., an infinite generator), then it'll halt. If the code will eventually return, then it'll be run, displaying results to the user. Seems simple enough, no?

You'll need some killer heurstics: https://en.wikipedia.org/wiki/Halting_Problem

That is all programs in general, checking a specific program is totally within bounds.

Re: Python 2.x vs 3.x use survey

#89

There was a dynamic graph somewhere showing the number Python 3 and Python 2 packages on PyPi against time, no amount of googling can find it, does anyone know what I'm referring to? I'd love that link.

Do you mean the wall of shame/superpowers? https://python3wos.appspot.com/

From a cursory glance it seems like this may be somewhat inaccurate. It states NLTK doesn't support 3, when it definitely does.
Post reply on HN