Things that won't change in Python
A lengthy and strongly opinionated post
about Python features to
the python-ideas mailing list garnered various responses there, from some
agreement to
strong disagreement to calling it "trolling", but it may also lead the Python
community to better define what Python is. Trolling seems a
somewhat unfair characterization, but Simon Lovell's "Python Reviewed
"
post did call out some of the fundamental attributes of the language and
made some value judgments that were seen as either coming from ignorance of
the language or simply as opinions that were stated as facts in a brusque
way. The thread eventually led to the creation of a document meant
to help head off this kind of thread in the future.
Good, bad, and ugly
Lovell's message started off with a short list of "The Good
",
but quickly moved into a list of "The Bad
" that included more
explanation of the features he disliked. It included entries
for things he was unhappy with: the colons at the end of if,
for, and similar
statements (which he deemed unnecessary), the lack of an end
statement for blocks (less readable), and no do-while loop. He also
thought that
the else clause for
loops should have a different name (and suggested whenFalse), that
print()
should not have been changed to a function in Python 3 ("adds no
positive value that I can see
"), etc. As might be guessed, he
ended with an entry for "The Ugly
". It complained about
non-zero integer values being treated as "true" ("crapulence from
C
" that violates the "explicit is better than implicit
"
principle from PEP 20).
Some of the entries in the good and bad lists were either incorrect or
misunderstandings of how to use Python, which put Lovell on the wrong foot
with many python-ideas readers. But his tone also put some off. As Stephen
D'Aprano put it: "As a newcomer to
this community, and apparently the language as well, do
you understand how obnoxious and arrogant it comes across for you to
declare what is and isn't 'good' and 'bad' about the language
[...]
". He warned Lovell that the tone of his message
might make responses "blunt or even brusque
", but he did
reply at some length.
For example, D'Aprano pointed him at the FAQ entry that explains the reasons behind the colons for if, et al. (readability, essentially). He also disagreed strongly with the need for an end statement, but agreed that else for loops was misnamed (though it is too late to change that now). Meanwhile, D'Aprano said that he preferred treating non-zero numbers as true values.
Chris Angelico also thought that the way Python does truth testing is both helpful and non-ugly:
D'Aprano and Angelico both agreed with the decision to change
print() to a function.
Angelico said that it "adds heaps of positive value to a lot of
people
", while D'Aprano was more specific about the advantages:
As a function, it can be passed around as a first class value, used as a callback, monkey-patched or shadowed or mocked as needed. None of these things are possible with a statement.
Overall, the thread proceeded like most in Python mailing lists. Folks
were generally helpful even when they were resolute about disagreeing with
Lovell. On the other hand, Lovell didn't seem to quite pick up the vibe of
the list. For example, responses like "I don't really see how
that can be argued
" or "I may be arrogant but I
can't take it seriously
" did not go over all that well.
Trolling?
Eventually, Guido van Rossum started a new
thread entitled "How to respond to trolling
". In it, he suggested that
responding to Lovell's posts was counterproductive: "I think a much
more effective response would
have been a resounding silence.
" But several thought that was not
entirely fair. Ned Batchelder said:
There were a number of suggestions in the original thread for Lovell to
take the topic to a different mailing list (python-list,
which is for more general Python discussions). Since Lovell wasn't really
suggesting changes to the language (at least formally), some thought the
discussion belonged on a different list. Though Nick Timkovich wasn't sure that even if Lovell had proposed
the changes it would be a topic for python-ideas: "If you're
proposing throwing half of Python's current syntax in the bin,
this isn't the right list either.
"
However Van Rossum was adamant that the Lovell's post did not deserve a response:
But D'Aprano saw things differently. What
Van Rossum had suggested was effectively "shunning" Lovell, which is
"a particularly nasty form of passive-aggression, as the
person being shunned doesn't even get any hint as to what they have done
to bring it on
". He also pointed out that it may not have been
clear to Lovell that he was crossing a line, because it is an unwritten
one:
Things that won't change
In an attempt to rectify the "undocumented" piece, D'Aprano proposed an informational PEP called "Things
that won't change in Python
". In it, he listed a number of things
that are known to be immutable in Python, but that perhaps those outside
the community are not aware of. The rationale, as described in the PEP, is
to reduce noise on python-ideas and other lists by heading off suggestions
that have no chance to be accepted "because
the benefit is too little, the cost of changing the language (including
backwards compatibility) is too high, or simply because it goes against
the design preferred by the BDFL
".
Some of the things listed in the PEP are fairly obvious (Python 3 will not be abandoned, there will be no Python 2.8), some were at least partly in response to Lovell's post (colons after if and the like, no end statement, print() will remain a function), and others came from recurring suggestions to the lists (no braces around blocks, significant indentation will remain, the >>> interactive prompt will stay as the default). Each entry comes with a bit of justification, often with links to a FAQ entry or other documentation.
In general the response was positive. There was naturally some wordsmithing (or bikeshedding) over the name and whether it should be a PEP or something else, but there was little disagreement over the listed choices—unsurprisingly. Van Rossum said that he had not followed the discussion closely, but that it made sense to delineate some unchangeable features of the language:
I would also guess that for things that are actually controversial (meaning some people hate a feature that other people love), it's much easier to explain why it's too late to change than it is to provide an objective argument for why the status quo is better. Often the status quo is not better per se, it's just better because it's the status quo.
Lovell did reply to Van Rossum's "trolling"
message, but was still on the offensive ("More than half of what I
suggested could have and should be implemented.
"). He also continued
to insist that Python's "truthiness" is ugly: "Calling truthiness of
non boolean data 'Ugly' is an insult? It is ugly.
" Brett Cannon,
who is one of the list administrators, tried one more time to explain why
Lovell was not getting the response he was seemingly looking for:
That led to a bit of a digression on the term "warts", which is sometimes used in the Python community to describe some missteps and misfeatures that exist in the language. It was mostly agreed that warts are "ugly" at some level, but it is a self-applied term, which makes it a bit more acceptable. And Van Rossum is not even sure they are missteps, exactly:
In the end, the situation was handled pretty well, as is always the case in the Python community, it seems. One can imagine a much ruder response that a critical post like that might receive in other free-software communities. So far, it doesn't seem like the PEP has gone anywhere since it was discussed in mid-January, but the exercise and discussion were useful; if nothing else it can serve as a place to point the next person who comes along with "great ideas" that will never become a part of Python.
Posted Feb 9, 2017 9:59 UTC (Thu)
by mjthayer (guest, #39183)
[Link]
"Don't feed the [person writing strongly opinionated things]" is a nice idea, but it doesn't seem to be very effective. To work it requires unspoken co-operation between everyone who might be reading a message who is able to post a reply. Wouldn't a better response, where private answers are available, be "only reply by private message unless you have a good reason not to"? Private answers are less likely to keep an unwanted thread alive and more likely to tie up the person writing in an opinionated way, keeping them from posting publicly. And people who do respond publicly inappropriately, or to repeat things which have already been said publicly, can also be asked privately not to do so.
Posted Feb 9, 2017 10:18 UTC (Thu)
by kokada (guest, #92849)
[Link]
Posted Feb 9, 2017 15:57 UTC (Thu)
by ncm (guest, #165)
[Link] (4 responses)
I am hoping our Benevolent Editor can offer a hint about why it matters. Is it that Python as a community has lost its ability to discuss topics rationally?
Posted Feb 9, 2017 16:41 UTC (Thu)
by corbet (editor, #1)
[Link]
Posted Feb 9, 2017 21:50 UTC (Thu)
by craniumslows (guest, #114021)
[Link]
Posted Feb 9, 2017 23:06 UTC (Thu)
by neilbrown (subscriber, #359)
[Link]
I think it would have fit perfectly in the "Maintainership" section I tried to propose recently. Promoting it from that (nonexistent) place to the front page is just an editorial decision based on available space and content
> I found it uniquely unenlightening for an LWN article.
I thought it was a great good-news story. A good counter-balance to the occasional "yet another flame war" stories.
Posted Feb 16, 2017 9:04 UTC (Thu)
by oldtomas (guest, #72579)
[Link]
This is interesting, in a meta kind of way :-)
You (obviously) don't seem to care for those "messy social problems", and that's OK. OTOH there are people around here who are thinking about why seemingly minor things (Indentation vs "begin...end" or {...}? Init system? Pfft.) have the potential of derailing a community. Often without even bad intentions involved.
I (and it seems some others) found this article very interesting: How does this Simon Lovell work? Why did he do that (he seemed really convinced). What could he have done instead? How was the reaction? How did it pan out?
Somehow there are here several "camps" -- the ones interested in "social stuff" and the ones not. Just like there are (let me simplify *a lot*) the brace-haters and the indentation-haters.
I always had a strong opinion (which has changed over the years). And while I don't really like Python very much, I have a high respect of the people doing it and I've learnt a lot from them (replace Python by most other "communities").
Me? I'm more of a Lisper. Braces? Indentation? Bah! :-)
Posted Feb 9, 2017 21:42 UTC (Thu)
by greened (guest, #52956)
[Link] (1 responses)
I'm indifferent about significant whitespace. It's redundant given block delimiters but I can see value in the parser forcing indentation to match block structure. Of course the tabs vs. spaces issue is still a major problem. Perhaps tabs should be banned from the language. :)
Posted Feb 11, 2017 3:00 UTC (Sat)
by k8to (guest, #15413)
[Link]
That's exactly why this document was created.
With hindsight, leading tabs should probably have been a syntax error, but I feel that this is one of those cases where introducing it now may be worse than leaving it as-is. Personally I'd be fine with paying the cost now of introducing that "breaking" change, because auto-handling in tools is not that hard. However, I'm strongly biased against hard-tabs in source code in general, so I don't trust my opinion here.
Posted Feb 10, 2017 6:19 UTC (Fri)
by rsidd (subscriber, #2582)
[Link] (12 responses)
I also like the somewhat more "purely functional" nature of Julia and the convention of denoting functions with side-effects with a "!" (as in "sort(a)" returns a new sorted list, while "sort!(a)" sorts the list in place. Python is a bit non-intuitive/inconsistent in this respect, eg "a.sort()" and "a.reverse()" sort/reverse in-place, "sorted(a)" returns a new sorted list, but "reversed(a)" returns an iterator, not a list. OTOH, people who like object-oriented programming and hate lots of nested parentheses would prefer python, I believe.
Posted Feb 11, 2017 3:07 UTC (Sat)
by k8to (guest, #15413)
[Link] (11 responses)
I feel the best strength of python is that if you use restraint and keep simplicity as a goal you can approach code that nearly every programmer in the world can read and understand right away. My impression of Julia as a total newbie is that it's targetting a similar space but much more off in the math, matrix, and functional world. There's a good deal that is unfamiliar to me as a general programmer in scanning the example Julia programs I can find.
Posted Feb 11, 2017 7:09 UTC (Sat)
by rsidd (subscriber, #2582)
[Link] (10 responses)
Posted Feb 11, 2017 8:54 UTC (Sat)
by k8to (guest, #15413)
[Link] (9 responses)
for n = 1:maxiter
I can guess but it feels odd.
v = zeros(t)
No idea, but could look it up easily.
v[i] = trace((P.'*P)^4)
I have no idea, and could not look it up easily,
Q = [a b; c d]
really no idea
m4 = [i+j+k for i=1:2, j=1:3, k=1:2] # creates a 2x3x2 array of Int64
Fairly unfamiliar to me that the expression to the right of the for inside the [] changes the "type" of the [] to be multidimensional. Maybe it would eventually be intuitive, but seems weird that the kind of array I'm getting here is buried in the details over on the right hand side.
by(...)
Just vastly unfamiliar.
I don't think any of this is bad design or a problem really, but it's speaking with a specialised lexicon, imo.
Posted Feb 12, 2017 3:49 UTC (Sun)
by rsidd (subscriber, #2582)
[Link] (5 responses)
The other points you raise are all linear algebra -- if you don't use matrices you don't need to bother with them, but if you do use matrices you'll quickly find such things indispensable (also, if you are coming from Matlab it will mostly be familiar). For example, the "list comprehension" type thing with three for statements is a multi-dimensional "array comprehension" (something Matlab lacks, as far as I know).
Posted Feb 12, 2017 10:40 UTC (Sun)
by mathstuf (subscriber, #69389)
[Link] (3 responses)
Because it makes splitting a range very easy. There's no need to do an offset to make two ranges that cover 0-2N because you can just do 0:N and N:2N instead of 1:N and N+1:2N (since inclusive ranges tend to be associated with 1-base indexing IME).
Posted Feb 12, 2017 16:11 UTC (Sun)
by rsidd (subscriber, #2582)
[Link] (2 responses)
Posted Feb 13, 2017 0:18 UTC (Mon)
by lsl (subscriber, #86508)
[Link] (1 responses)
https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08x...
Posted Feb 13, 2017 5:05 UTC (Mon)
by rsidd (subscriber, #2582)
[Link]
Posted Feb 12, 2017 12:02 UTC (Sun)
by k8to (guest, #15413)
[Link]
Posted Feb 12, 2017 3:57 UTC (Sun)
by rsidd (subscriber, #2582)
[Link] (2 responses)
Posted Feb 12, 2017 12:03 UTC (Sun)
by k8to (guest, #15413)
[Link] (1 responses)
Posted Feb 12, 2017 16:07 UTC (Sun)
by rsidd (subscriber, #2582)
[Link]
Things that won't change in Python
Things that won't change in Python
Huh?
Many projects are subject to a stream of people who show up with "good ideas" that can never be adopted for any of a number of reasons. This topic was a look at how one project deals with this problem and an attempt to document why some recurring ideas will never fly. I thought the topic was interesting, sorry if you disagree. We'll return to RPM-v.-Debian flamewars soon, don't worry :)
Huh?
Huh?
Huh?
Huh?
(Please: don't take my amusement as a personal offense -- that would be terrible).
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
It also has a fair amount of -> going on in a fp manner, which is fair enough but jarring to a typical imperative programmer.
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
That's very interesting. When I first started using julia I found the one-indexing off-putting. There is a long thread here. The first poster invokes python and a nice box-diagram, but not Dijkstra (whom others do bring up later). Ultimately the Julia argument seems to be 1-indexing is more familiar to mathematicians and more common among mathematical languages (including fortran and mathematica). In practice I have found I make occasional errors (because I am used to python and continue to use it heavily) but it's not as big a deal as all that...
Things that won't change in Python
Things that won't change in Python
Things that won't change in Python
Q = [a b; c d]
would in numpy be
Q = numpy.matrix('1 2; 3 4') # note the quotes
except it doesn't work with variables inside the quotes. The following would work instead:
Q = numpy.matrix([[a,b],[c,d]])
Things that won't change in Python
Things that won't change in Python