Live data from Hacker News

Python 2.x vs 3.x use survey

surveymonkey.com

51–60 of 119 posts

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

#51
post #25

"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 think that's a very significant question. I would guess that 50%+ of Python users don't use Python 3, and thus would be counted as anti-Python-3, if not for that question which allows them to say "I don't think Python 3 is inherently a bad idea."

It would be nice if the question were more specific and more positive, but the survey would be worse if it were simply taken out.

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

#52
post #25

"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 have problems with the way this is worded as well. I don't think Python 3.x was a mistake. I think the mistake is continuing to develop it in parallel with 2.x with no definitive end of life for 2.x is the mistake.

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

#53
post #45

Earlier quoted context omitted.

FWIW: 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")

I understand this, but couldn't you simply wrap print itself in a function, and do that in Python 2.7 already? Granted, your method saves you one line and it's more 'natural'.

Not really, since the Python 2 version is a keyword, and not a function, you can't simply provide keyword arguments to it. You would instead have to build up a string and eval it. It would have to be something like this (completely untested):

    def print_wrapper(*args, **kwargs)
        outfile = None
        print_stmt = "print "
        if 'file' in kwargs:
            outfile = open(kwargs['file'], 'a')
            print_stmt += '>>outfile '
        print_stmt += ", ".join(*args)
        if 'end' in kwargs and kwargs['end'] == ' ':
            print_stmt += ','
        eval(print_stmt)
        if outfile is not None: outfile.close()
sep and other end values for anything other than ' ' would not be possible.

http://docs.python.org/2.6/reference/simple_stmts.html#the-p...

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

#54

Earlier quoted context omitted.

I can't say I understand this attitude. It's analogous to cutting off your nose to spite your face. Both Python 2 and 3 are actively supported, and there's a clear migration path defined. The migration isn't complete yet, but it's progressing at a development friendly pace. I say this as someone still on Python 2.6 due to environment restrictions.

The migration is so difficult that you might as well migrate to a different language and solve the speed and memory usage issues while you're at it.

What language would you recommend, that would have a similar jump in syntax, and still give you more speed and resolve memory usage?

Go? Go is painfully statically typed (painful example: requiring you to cast an int to float32 to do a `>` or `Ruby? Same speed and memory "problems" as Python.

Perl? Faster, but its language design philosophy is diametrically opposed to that of Python.

Clojure/Haskel? Syntax and program structure are so radically different from Python there's no comparing them to Python3 when discussing differences from Python2.

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

#55
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...

Neither does Python2.

    $ python
    Python 2.7.5 (default, Aug 25 2013, 00:04:04)
    >>> xrange(10)
    xrange(10)
    >>> list(_)
    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

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

#56
post #44

Earlier quoted context omitted.

I wouldn't, not yet. There's not enough support. Great ideas, but the support isn't there for it yet: not in libraries, not in operating systems, not in documentation. 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.

But for the newbie user it's a nightmare. If you google "Python training" you're going to get books, sites that offer training from 2.5 to 3.3. And those are recent sites (like 2012+). Not to mention pip and package management - which compared to ruby, is just terrible. I mean there isn't even an update all command in pip. And of course if you have different versions of python you have different versions of pip. With…

You're always going to have old documentation on the Internet (and it's a good thing!). The more annoying problem I encounter (not Python specific) is blog posts or news stories without publish dates.

All of the Python communities I've seen have a "Python 2 or 3?" section that's pretty clear--"depends on what you want to get done. Python 2 is most widely deployed. Python 3 is complete but lacking an install base and library support." I've written a small amount of code in Python 3 and they're not that different.

I entirely agree about package management (and virutalenv). It finally appears they have a way forward with package management. If that's implemented in Python 3, it'd be a significant reason to adopt. Virtualenv is already part of Python 3.

At my workplace, we're still transitioning from Cent5 (ships with Python2.4, but we're using 2.6) to Cent6 (ships with 2.6). Our third-party packages are still on 2.6 and the newest versions of them are finally using 2.7. So we've brought up Python3, but are still just talking about moving to 2.7. I, too, wish adoption of Python3 was faster, but even if there were more enticing features my workplace is beholden to the platform we're using. I think now that newer distros default to Python3 is fantastic, and it will take the long term versions defaulting to them before most companies are convinced to switch (still a few years off).

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

#57

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.

Yes, well, that's why I said it would be sweet of them. You know, like, a grouchy old military dad taking his daughter to see Snow White. It may not he his choice of entertainment, but it's very sweet of him to take her. :-)

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

#58

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.

They did have a Python implementation for a while (IronPython)

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

#59
post #44

Earlier quoted context omitted.

I wouldn't, not yet. There's not enough support. Great ideas, but the support isn't there for it yet: not in libraries, not in operating systems, not in documentation. 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.

But for the newbie user it's a nightmare. If you google "Python training" you're going to get books, sites that offer training from 2.5 to 3.3. And those are recent sites (like 2012+). Not to mention pip and package management - which compared to ruby, is just terrible. I mean there isn't even an update all command in pip. And of course if you have different versions of python you have different versions of pip. With…

> If you google "Python training" you're going to get books, sites that offer training from 2.5 to 3.3. And those are recent sites (like 2012+).

That's because these are all still valid versions of Python (which are still shipped with OSes). Most of the concepts you learn in Python 2.5 are still valid in Python 3.3; the changes weren't that dramatic. There are still strings, the control mechanisms didn't change, logic still uses the same operator precedence, the syntax didn't change...

Yes, there are now byte and unicode strings (as there were in Python 2), yes, print is now a function, yes, a few functions now return iterators instead of lists, and yes, a few functions/packages were renamed. Pretty minor changes, in the long run; breaking changes yes, but still minor for all that.

> Everyone should jump onboard the python3 wagon.

No, they shouldn't. You should never risk your production critical code just because a language wants to evolve. Perhaps this is a difference from Ruby (particularly Rails) where there appears to be an "evolve or die" philosophy, whereas Python says "we're here when you're ready, but we're not going to ignore you". It honestly makes me happy to work with Python, where I don't have to chase down a production fire because a developer decided to make a breaking change.

I will personally move to Python 3 when it's prudent to do so - when the environment I develop for supports it natively. Until then, I'm glad I'm not being forced to move ahead. It makes my day to day life as a developer simple.

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

#60

Earlier quoted context omitted.

This isn't actually true anymore for many, many things: - The major scientific/numerical packages support Python 3 (pandas, numpy, scipy). - The best database library supports Python 3 (SQLAlchemy) - A substantial fraction of important support libraries support Python 3 (e.g. lxml, PIL/pillow) - Django supports Python 3 I'm honestly a little confused by people who claim that library support for 3.x "isn't there yet".…

oh please. one single dependency that doesn't support py3 is the death knell to using it for anything, EVER I use python daily at work and you can be safely assured the state of py3 on pypi is fu$$$$ed. (we use pyramid not django for what it's worth)

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 language?

Post reply on HN