
Python 2.x vs 3.x use survey - janzer
https://www.surveymonkey.com/s/N5N5PG2
======
jordigh
For Mercurial, this is the biggest problem with Python 3:

[http://bugs.python.org/issue3982](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 itself is hosted with hg. :-/

~~~
Groxx
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?

~~~
jordigh
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.

~~~
Groxx
Mercurial is a big project. Surely there's _one_ skilled C programmer who
could write a relatively-portable, efficient, limited version of this feature
(or find one, I assume something extremely similar exists in several flavors).
Once that's done, have a Python fallback for those esoteric systems where it
doesn't work, and move on with life. Since it's apparently a critical code-
path, that's _normal_ development for great performance.

I could easily be underestimating the difficulty of integrating C with Python
- I've never done it personally, but I gather that's one of its strengths. But
this seems like a pretty simple _problem_ , which has a pretty simple
implementation in any language (there's an included Python implementation on
the linked page, ~20 LOC?), and if it's a critical performance piece it's
surely worth the cost to make that piece.

~~~
jordigh
It's more work than it appears. And it's work that doesn't seem to have
immediate benefit, since Python 2 is still around. Augie Fackler has started
tackling it, but even if we do get the change to Python 3 itself, it also
requires a substantial rewrite of the hg codebase, since we use strings
_everywhere_. And again, it's a lot of work with no huge payoff.

~~~
Groxx
> _It 's more work than it appears._

I completely believe that, and good point about Python 2. I wasn't considering
that side of things.

Is it a _complicated_ rewrite, or just _big_? Superficially it seems pretty
mechanical, `bytes.format` to `bytes_format` (though finding them might be
hard). I never feel like I have free time, but I don't tend to get exhausted
from things like that, maybe I can contribute a bit. It would be good to get
exposed to some decent, real Python code :)

~~~
jordigh
Come join us in #mercurial in Freenode or in mercurial-devel@selenic.com if
you're interested in solving this problem.

------
crag
"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.

~~~
comicjk
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.

~~~
reuven
It's way way way higher than 50%, if my sample is accurate.

I've been teaching Python in China, Europe, Israel, and the US for years. In
the last four years alone, I've taught about 2-3 Python courses (usually
intro, but sometimes advanced or on specific topics) each month, at companies
like Apple, Cisco, Intel, and SANDisk.

In only one case did a company ask me to teach them Python 3. The rest of them
ask specifically for Python 2. In some, more advanced and unusual cases, they
ask me to describe the changes that will happen in Python 3. They all have
legacy code in Python 2 that they cannot imagine upgrading, mostly because
there are libraries (internal or external) holding them back -- and the
benefits aren't obvious.

(I should note that almost none of my courses are at startups. So it's quite
possible that I'm seeing a sample of large companies, which are inherently
more conservative than smaller ones.)

I thought that the survey was fine. But really, there's a problem in the whole
Python 2/3 split, and while I've convinced myself over the years that people
are switching, I've rarely met any of them. Which is really too bad.

~~~
kremlin
Being a newbie at Python myself and seeing how much the Python devs are trying
to get people using Python 3, I was initially planning on just using Python 3
for all my Python coding. That was until I realized how many libraries exist
only for Python 2.

------
deckiedan
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...

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

~~~
deckiedan
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. :-)

------
tsuraan
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...

~~~
dragonwriter
> 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.

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

------
nixarn
Only reason I still use 2 over 3 is that 2 gets the job done, is well
supported and I don't see a big enough reason to move to 3. If 3 had a big
performance increase, then maybe I would switch. Anyhow, I'll probably move to
3 at some point just because at some point more people use it (more code on
the Internet in 3, more StackOverflow answers in 3 etc.)

------
ddebernardy
The 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.

~~~
falcolas
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.

~~~
stefantalpalaru
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.

~~~
falcolas
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 `<` operation) and feels a lot more like
writing C than Python (not to mention its lack in the "batteries included"
department).

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.

~~~
maxk42
I would actually pick Go. Yes, the strong static typing is a pain in the ass,
but the rules are simple and regular. It's easy to understand and implement.

The same cannot be said for the multitude of changes to Python.

~~~
codygman
I use/used Go for a while, but early on I thought the type system was stronger
than it was. I was disappointed in a later project, and started looking at
languages with stronger type systems.

I came across Haskell and Hindley Milner ;)

I believe Haskell replaces Go for me and with some experience (when I can
picture types in my head better) it will replace python as my go to dynamic
language.

------
dec0dedab0de
Missing 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.

~~~
dded
Personally, I prefer function. I can understand that others have a different
preference; what I find surprising is the number of people who seem to care
_so much_ about this. Nevertheless, it is very evident that you are not alone.

~~~
bcj
I prefer it as well. Being able to do things like throw

    
    
        print(<SOMETHING I'M TRYING TO DEBUG>) or
    

into a lambda has been useful on multiple occasions.

------
ballpark
It would be nice if we could see the results

------
infocollector
Where are the real-time results? :)

------
analog31
In my view, the importance of the 2 vs 3 issue depends on who you think the
typical Python user is, and the user population may be changing rapidly.

I'm not a CSist or professional programmer. I use programming as a tool,
typically to solve short term problems for myself or for a small circle of
colleagues. When I started using Python, not too long ago, it seemed like I
had discovered a secret productivity tool. A project manager asked me: "What's
a Python?"

Today, Python seems to be everywhere. It's been taken up by curious characters
such as scientists and hobbyists. It seems to be the lingua franca of the
Raspberry Pi. My non-CSist colleagues are getting into it, and I don't think
it's just because of my incessant evangelism. ;-) A great thing about Python
is that you can use it at whatever skill level you happen to be at, by
ignoring its advanced features until you need them.

I could switch from 2 to 3 today, but I'm lazy. I'd get bonked by errant print
statements for a while, and probably not experience any other hurdles. I spend
more time already, keeping up with the changes that I make to my own
libraries.

------
bobx11
I may be old, but this just reminds me of Larry Wall's Perl 6 and in my
opinion Python 3 should have been a hobby project / incubator for changes that
could be introduced to Python 2 eventually.

------
davvid
I'd also like to see the results. Curious, did you create this survey to see
if there would be interest in a long-running Python 2.x fork?

IIRC the Python community was already expecting a fork to happen eventually
(because 2.7 is the "final" 2.x release) so getting the community involved
would be a good thing.

I would imagine that the purpose of maintaining 2.x would be for fixes,
security, and back-porting of features that make it easier to have 2.x and
3.x-compatible code.

------
janzer
Results from this survey can now be found at

[https://wiki.python.org/moin/2.x-vs-3.x-survey](https://wiki.python.org/moin/2.x-vs-3.x-survey)

------
sitkack
A wise man once said,
[http://www.aaronsw.com/weblog/python3](http://www.aaronsw.com/weblog/python3)

------
brownbat
I'm curious what the Python 3 adoption status is inside of Google, which I
think of as a place that's relatively pro-Python, very pro-new stuff, but also
possessing a lot of institutional inertia and giant amounts of code. Have
parts of Google overcome the inertia and switched to 3? Do fights break out in
the halls? Is it 2 forever and always?

------
sontek
I don't think people realize how easy it is to run a Python2 and Python3
codebase at the same time if you have decent test coverage and run tox.

Before PyCon SurveyMonkey(my employer) will be deploying a major part of our
application on Python3.

------
kccreator
I don't really have a strong reason to prefer 2.x, but I'm stuck on it as I
mostly (exclusively) use Python on Pythonista for iOS.

But I'm fascinated by the debates over the merits of the two. Thanks for
posting the survey!

------
gejjaxxita
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.

~~~
chaosphere2112
Do you mean the wall of shame/superpowers?

[https://python3wos.appspot.com/](https://python3wos.appspot.com/)

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

~~~
walrus
The NLTK site says the Python 3 version is still alpha.

------
wheaties
My only question is... does Gunicorn+Gevent work on Python 3 yet? Last time I
checked one worked and the other only had a branch which you could use but
wasn't in master yet.

