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
Python 2.x vs 3.x use survey
81–90 of 119 posts
Re: Python 2.x vs 3.x use survey
#82Dear 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.
Re: Python 2.x vs 3.x use survey
#83Earlier 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…
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
#84The 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.
Re: Python 2.x vs 3.x use survey
#85Re: Python 2.x vs 3.x use survey
#86The 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)
Re: Python 2.x vs 3.x use survey
#87For 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?
Re: Python 2.x vs 3.x use survey
#88Earlier 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
Re: Python 2.x vs 3.x use survey
#89There 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/