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...
Python 2.x vs 3.x use survey
31–40 of 119 posts
Re: Python 2.x vs 3.x use survey
#32The 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...
Re: Python 2.x vs 3.x use survey
#33"Do you think Python 3.x was a mistake?" That's where I stop filling out the survey. And that's the python community biggest problem. Moving forward, everyone needs to pick a version (and I'd pick 3). A new user just sits and spins his head. Even the training materials are all over the place.
I don't think Python3 was a mistake, but the migration is going to take time. Cutting off either group would have been a terrible decision, and I'm glad they didn't.
Re: Python 2.x vs 3.x use survey
#34"Do you think Python 3.x was a mistake?" That's where I stop filling out the survey. And that's the python community biggest problem. Moving forward, everyone needs to pick a version (and I'd pick 3). A new user just sits and spins his head. Even the training materials are all over the place.
Ultimately, you did pro-Python 3 supporters a disservice by not speaking up.
Re: Python 2.x vs 3.x use survey
#35Missing a question. "Would you switch to python 3 if they brought back the print statement" Edit: I really just like the statement for the interpreter, and IPython Notebook. To me the statement syntax feels less like programming, and more like using a computer.
What is the advantage of python 2 print over python 3 print? I believe that python 3 print can do everything python 2 print can do on the same level of elegancy. Also, python 2 print has a weird trailing-comma syntax. When a trailing comma is added to a print statement, a space is printed when another print statement is used. For example, print 'hi', # prints hi (no extra space in the end) print 'hi',; print 'hi' # p…
print 'hi',
do_something()
print 'there'
and print 'hi', 'there'
both yield hi there
(Assuming do_something() doesn't call print itself)Re: Python 2.x vs 3.x use survey
#36The survey is missing sets of answers for users who rejected or moved away from python because they were turned off by the disconnect between core devs and the community when python 3 got released.
I say this as someone still on Python 2.6 due to environment restrictions.
Re: Python 2.x vs 3.x use survey
#37Earlier quoted context omitted.
What is the advantage of python 2 print over python 3 print? I believe that python 3 print can do everything python 2 print can do on the same level of elegancy. Also, python 2 print has a weird trailing-comma syntax. When a trailing comma is added to a print statement, a space is printed when another print statement is used. For example, print 'hi', # prints hi (no extra space in the end) print 'hi',; print 'hi' # p…
no trailing space is a convenient shorthand - print by itself prints with a newline (so it might make sense to have print() vs println()); print + comma omits the newline and waits for the next print statement, so that print 'hi', do_something() print 'there' and print 'hi', 'there' both yield hi there (Assuming do_something() doesn't call print itself)
pprint = functools.partial(print, end=' ')
pprint('hi')
do_something()
print('there')
print('hi', 'there', sep=' ')
I appreciate the fine grained control, and the ability to do things like `functools.partial` on it. fprint = functools.partial(print, file='/var/log/foo.log')
fprint("I'm writing to a file!")
fprint("So am I")Re: Python 2.x vs 3.x use survey
#38Re: Python 2.x vs 3.x use survey
#39There 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/
Re: Python 2.x vs 3.x use survey
#40The 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...
Write it as a list comprehension instead; it has identical syntax except for using square brackets instead of parentheses, and returns a list.
Would the following work? It's been a while since I've had Py3 installed, so I can't casually try it. In your PYTHONSTARTUP, place the following:
_map = map
def map(f, *args):
return list(_map(f, *args))
So you get lists in interactive mode, but iterators in actual scripts.