[off-topic] The Case Against Python 3

已查看 128 次
跳至第一个未读帖子

Vinicius Assef

未读,
2016年11月24日 06:04:352016/11/24
收件人 pylons-...@googlegroups.com
Hey guys.

As Pyramid was the first framework supporting Python 3, what do you
think about this position?

https://learnpythonthehardway.org/book/nopython3.html

What are your experiences regarding Python 3 as broken?

--
Vinicius Assef

Mikko Ohtamaa

未读,
2016年11月24日 06:31:192016/11/24
收件人 pylons-...@googlegroups.com
Bullshit. All new works I have been working are Python 3 based and Python 3 is much better language to work with.

Due to natural change resistance in human beings, a very well studied psychological effect, you always find people who go to great lengths to resist a change. There will be always pain in a change. People try to justify their viewpoint by cherrypicking arguments against the change, without seeing what good it would bring for them.

However, this being said, Python 3 transition was a mess and in hindsight everybody can tell it could be handled better. JavaScript community has not made the same mistake with ES2016 and co. But the change has happened and if you are still complaining, it's like 10 years too late.

-M




--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAFmXjSDn72hbPuF50ppbjL5z8VKm61o10TiG8khAMrF-40pc%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

Brian Sutherland

未读,
2016年11月24日 06:47:152016/11/24
收件人 pylons-...@googlegroups.com
It's just really funny that this was written at the precise moment I
feel like the library-support inflection point has been reached and I
can start doing everything in python 3. In my experience python 3 is
also definitely a better language.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
Brian Sutherland

Christoph Zwerschke

未读,
2016年11月24日 07:03:152016/11/24
收件人 pylons-...@googlegroups.com
Has the same taste as the recent election campaign. Start with
extraordinary and alarming, but totally false and uneducated claims
("Python 3 is not Turing complete", "you can't run Python 2 and Python 3
along with each other" etc.) and conclude that we should revert
everything and do things in the old ways. Same spirit as "climate change
is a hoax, let's continue to burn fossil fuel" or "who needs diversity,
let's continue to make politics for straight white male people only as
we did in the good old 1950s."

My personal experiences with Python 3 are very positive, I do not
perceive things as "broken", but moving into the right direction. Many
mistakes that have been made in the beginning of the transition have
already been fixed. And I see Python 3.6 as another great step forward.
Evolution is good, don't worry, don't be stagnant.

-- Christoph

Thierry Florac

未读,
2016年11月24日 08:25:542016/11/24
收件人 pylons-...@googlegroups.com
Perfectly agree with previous comments!
I can't estimate the theory behind Turing machines and so on. But on a practical point of view, I worked for a long time with Python 2 and Zope 3 and had to upgrade all my private packages to use them with Python 3 (starting with Python 3.) and Pyramid: the result is according to me much cleaner and simpler than it was before, especially for many strings management concerns!
Finally I prefer using Python 3 today, and as all major libraries have now been ported to it, compatibility is no more a major concern with it.

Regards,
Thierry

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to pylons-...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Chris Rossi

未读,
2016年11月24日 09:40:472016/11/24
收件人 pylons-...@googlegroups.com
Transition could have been better handled, but Python 3 is great once you get over.

Chris

John Anderson

未读,
2016年11月24日 10:08:282016/11/24
收件人 pylons-...@googlegroups.com
For the last 2 years every project I've worked on has been Python3 only. At SurveyMonkey we had ~60 different services and ported all shared code between them to Python3 four years ago and started shipping production Python3 two years ago. 

It is a much better language and it really annoys me working on Python2 these days.  I think it is ridiculous to even discuss the transition these days. Yes, it was horrible but at this point every important library has been ported and it is no longer an issue to use Python3.


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.

Tom Lazar

未读,
2016年11月24日 10:21:092016/11/24
收件人 pylons-...@googlegroups.com
I can literally +1 *all* of the previous replies. 

Sent from a phone, please excuse the brevity.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.

To post to this group, send email to pylons-...@googlegroups.com.

Mikko Ohtamaa

未读,
2016年11月24日 11:21:312016/11/24
收件人 pylons-...@googlegroups.com
Community seems to agree and did not like this behavior.

On Reddit /r/python and /r/learnpython has removed links to Zed's tutorials. While Zed is a respected community member and has done a lot of hard work for making Python available especially for newcomers, he might be have been little bit too emotional and less rational with the latest blog post.

-M

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Bert JW Regeer

未读,
2016年11月24日 12:07:482016/11/24
收件人 pylons-...@googlegroups.com
https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/

I will be the first to admit that I at one point looked up to Zed, he was always coming out with some new piece of software, iterating quickly, and sure he used to yell at communities and projects, but in general they actually contained real grievances and issues that should be fixed.

At this point I have realised that he is no longer someone to pay attention to, someone to look up to. He has become a has-been, and he is no longer relevant. His increasing tirades against Python 3 have culminated in his most recent blog posting, and it shows he is no longer someone worth paying attention to.

I am not surprised that various communities around the web have decided that removing links to his resources is in their best interest moving forward.

Bert
>> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
>> To post to this group, send email to pylons-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/cce59e52-512c-9fcd-cbb9-832113a6b2c0%40online.de.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> http://www.imagesdusport.com -- http://www.ztfy.org
>>
>> --
>> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
>> To post to this group, send email to pylons-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAPX_VWAnt%3DGuuS2Vnyh_mybhXb-pscyQqXX9mcJ4ANGfzsShdQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
>> To post to this group, send email to pylons-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAGZ7LV8Cow5%3DFvKU3BR2kgpsKqraxzy_P%2Bgaq7W11Zg1QH0s%2BA%40mail.gmail.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
>> To post to this group, send email to pylons-...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAOdFaDXS193WC8y93G%2BT%3DBLa5ATh-aBgqBsusd9obdF%3D%3D1CgiA%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAK8RCUs4sX27xjAcTDZ2hp0kOcXC2vddzmSYM0s2wzf3wknYGw%40mail.gmail.com.

wilk

未读,
2016年11月24日 13:05:212016/11/24
收件人 pylons-...@googlegroups.com
I think Python 3 is a good language also, but the decision to update all
my legacy code made me look at others languages. I found Go a better
investment, specially that i found the design of the web server api very
close to what i do with Pyramid.

--
William

Mike Orr

未读,
2016年11月24日 14:27:122016/11/24
收件人 pylons-...@googlegroups.com
I have a friend who teaches Python to beginners and uses it for
scientific programming, so I'll see what he says. The biggest holdup
in Python 3 adoption has been third-party dependencies, especially for
applications that use a lot of them. Pyramid has a lot of dependencies
because it was designed to use "best of breed" libraries rather than
reimplementing their functionality. But Pyramid has been Python 3
compatible since near its first release around 2010. SQLAlchemy and
Mako soon followed, and that covers the largest percentage of Pyramid
applications. Pyramid later unbundled non-essential features like
'pyramid_mako', so it has even fewer dependencies now. I have ported
two Pylons applications to Pyramid and Python 3, a third is ported to
3 but not fully tested there yet, and a fourth that is still in Pylons
and Python 2 and will probably be converted to Javascript. In all
cases the problems were third-party libraries that weren't Python 3
compatible yet, or finding time to convert the application.

My friend the teacher does complain about how Python 3 forces the
separation of strings and bytes: why not leave it as it was? So he
would be sympathetic to that argument, and he preferred to stick with
Python 2, but he's now migrating to 3 because it's the future.

"The Case Against Python 3" is 95% hysterical rant and 5% accurate
critiques. But none of the critiques are fatal to Python 3; they're
just things that could have been handled better. Zed's argument starts
from a rigid and rather esoteric position, and anything that doesn't
match that position is wrong. So the ultimate problem is Zed's
position and criteria, which many people would disagree with.

Is Python 3 dead? No, it recently reached the tipping point of
accelerating adoption. Is it really only at 30%? Where did he get that
figure from? It's impossible to know how many programs are running in
Python 3 vs 2 because users aren't required to register them. It's
also too early to tell 2020 is a realistic cutoff for Python 2
support. Maybe it will be extended, maybe not.

Python has had several false starts during its evolution. The '2to3'
translator, the string formatting functions, and the string/unicode
problems are just three of them. But expecting every decision to be
perfect requires a 100% reliable crystal ball. The developers
initially assumed most people would use '2to3'. But most people
eventually found they could get 90% of the way with Python 2/3
compatible code, and use something like 'six' to bridge the gap.
There's also '3to2' now, as people realize it makes more sense to
write forward-compatible code now and just back-translate temporarily.

Zed ignores the reasons for the changes. Python's developers believe
Python 2's hybrid behavior was a horrible mistake, and it causes
obscure exceptions far away from where the variable was set. The
change was to make Python more reliable and predictable. Zed makes a
usability argument that changes should focus on the user's desires,
not on the developers' desires. But this really was a case where it
helps users in important ways even if they don't realize it at first,
and it's the only way to get rid of the sloppiness in Python's
behavior that led to those obscure exceptions. Zed is asking for the
Python 2 behavior to be included in Python 3, but that also means
re-enabling all those obscure exceptions that kept users spending
nights awake trying to figure out what was wrong with their program. A
hard UnicodeDecodeError/UnicodeEncodeError earlier is easier to
troubleshoot, and functions like 'pyramid.compat.text_' and
'pyramid.compat.binary_' can guarantee you'll have str or bytes even
if the origin is unreliable.

PEPs 528 and 529 refer to incompatible differences between how Windows
and Unix interpret filename strings and console I/O strings. This
requires an approach that can work on all these platforms. It's not a
general string/unicode hybrid model, and re-introducing the
ambiguities between the two would only make things worse.

A "Turing machine" is an imaginary concept. It has infinite memory
("the tape")., or at least it can create unlimited memory on demand.
"Turing complete" means a language has minimum control structures
(if-then, loop-break). Python has these with its 'if-then' and 'while
True: break' constructs. It does not mean that any particular virtual
machine must be able to run foreign languages. It means that you must
be able to write a Python program that emulates another language. Of
course you can. It just means it will just be using that program's
"virtual machine" rather than the Python virtual machine directly.

The string formatters came about because users were dissatisfied with
the previous ones. They did not appear one right after the other,
there were several years between each. Arguably the new f"abc{foo}def"
should have been the original one -- but we can't even say that
because not enough people are using Python 3.6 yet to verify this.

That's enough critique for now.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAFmXjSDn72hbPuF50ppbjL5z8VKm61o10TiG8khAMrF-40pc%2Bw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Mike Orr <slugg...@gmail.com>

Mike Orr

未读,
2016年11月24日 14:54:312016/11/24
收件人 pylons-...@googlegroups.com
It also reminds me of the switch to the metric system. The reason
Americans are adverse to it is that it was taught in school in the
1970s as a bunch of obscure conversion functions. A meter is 39
inches. A kilometer is 5/6 of a mile. A centimeter is tiny compared to
an inch; look at a ruler. A liter is a bit more than a quart. To
convert from Fahrenheit to Celsius, divide by 2 and add 32. People's
math homework was all these tedious conversions.

But that's not how people in metric countries use the metric system.
They just move the decimal point left and right and change the unit.
They follow metric recipes. They compare 500 milliliters to 1 liter.
They have an intuitive feeling of how warm 20 degrees Celsius is, and
how warm 30 degrees Celsius is. The only time they use the tedious
conversions is when they have to compare it to something in English
units, which is rare. Even Americans, if they start in metric such as
the secondary number on a food can, or the other side of the ruler, or
their speedometer when they're in Canada, can easily compare it to
other metric units and remain in metric for the entire situation. And
they do sometimes use millimeters rather than inches because it's a
conveniently short unit for short or precise things.

So it's like going from Python 2 to 3. Converting programs is hard,
but after that it's easy, and you get access to more features
(analogous to just moving the decimal point left and right, or having
freezing and boiling at 0 and 100). Once you are in 3, you rarely have
to deal with 2, unless you encounter an old program or library.

Thierry Florac

未读,
2016年11月24日 15:38:052016/11/24
收件人 pylons-...@googlegroups.com
Here is another feedback about Zed's article: https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/

Regards,
Thierry


--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/CAH9f%3Dura5LPgW9Xp9MM_UzT8G6pZqQyEohk7P%2B28wwcEtRUJ4Q%40mail.gmail.com.

Mike Orr

未读,
2016年11月26日 17:39:362016/11/26
收件人 pylons-...@googlegroups.com
On Thu, Nov 24, 2016 at 11:27 AM, Mike Orr <slugg...@gmail.com> wrote:
> I have a friend who teaches Python to beginners and uses it for
> scientific programming, so I'll see what he says.
> [He] does complain about how Python 3 forces the
> separation of strings and bytes: why not leave it as it was? So he
> would be sympathetic to that argument, and he preferred to stick with
> Python 2, but he's now migrating to 3 because it's the future.

Here's the reply from my friend Chris Barker:

{Re "The strings in Python 3 are very difficult to use for beginners. ")

CB: This is just plain wrong, I have been very pleasantly surprised
that my students have had NO issues with strings with py3 -- I don't
even need to teach a single thing about Unicode, whereas with py2, if
anyone wanted to use a non-english language, it needed to be
introduced early.

CB: I will say that py3 is a little pit less of a "scripting"
language, and more of a "systems" language. Even really little stuff
like print as a function makes it a little bit harder to whip out a
quickie script -- but that's not an issue for newbies that do intend
to work on larger systems.

CB: Very few people ever need to deal with bytes at all. The
string<>bytes thing has been a pain for folks doing low level protocol
libraries, but not an issue at all for newbies.

(Re Chris preferring Python 2.)

CB: I don't have any preference for sticking with py2 -- the
transition pain is unfortunate, though.

(Re format strings and Python 3 libraries.)

CB: The multiple formatting methods is too bad, but it's actually the
result if keeping backward compatibility - no one wants to disallow
also style % formatting. And for newbies, I just teach .format() -- no
problem there. I'll reserve judgement on f strings -- though I'm not a
fan yet.

CB: [using only f-strings is] probably not a bad idea -- but it only
works if your data you are using to format the strings is in local
variables -- what if you need to format a string from a dict???
.format is not legacy -- it's really useful, though maybe more for
advanced use cases. It does look like f-strings use the same
formatting language as .format() -- so that's really nice.

CB: There WERE some big issues with strings for folks writing "wire
protocol" code, where text and binary data are mixed -- and I think
those were addressed: surrogate pairs and bytestring formatting were
added.

CB: py3 introduced much smother compatibility between integers, long
integers and floats -- you'd think he's like that :-)

And that works because when you have a float, you know how it's encoded...

CB: I do want numpy to have a bytestring type, which it doesn't, but
that's only because it would be nice to have a compact type for
strings that are mostly ascii anyway.

CB: Though the introduction of pathlib without any other stlib stuff
allowing is was pretty lame -- I _think_ that's getting fixed for 3.6.
That's not a string issue, though.

(Re "Some people go so far as to ban my book because it does not
support Python 3, even though my book is the most effective method for
learning to code.")

CB: No one is "banning" his book. For one, no on is in the position to
ban anything, and for two, I at least, still recommend it to my
students, even though I'm teaching py3.

(Re " The solution is to create a "string" type that magically knows
how to be Unicode or raw bytes")

CB: This is actually what py2 did after introducing Unicode -- it
wasn't a magic string type, but it did auto-convert all over the place
-- and that was actually the source of most of the problems.

(Re "Python has a really good Chardet library")

CB: He's got a good point here, but I thin he's very wrong about where
it shoudl be applied -- haivng a good encoding detection at teh
boundaries of the app would be nice: open a text file, and allow
auto-detection of encoding -- the user gets nice clean unicode strings
-- very nice. But having that kind of auto-detection happen inside
your app whenever bytes meets strings is a really bad idea -- it can
fail, and whether it fails depends on the data, not types or anything
you can test properly ahead of time.

--
Mike Orr <slugg...@gmail.com>
回复全部
回复作者
转发
0 个新帖子