Also many things about python that I don't like such as `len` being a function rather than a method on a list are very trivial when coming from a language like C which has hordes of tiny inconsistencies.
The whitespace thing in python is pretty gimmicky but does also hold a certain amount of pedantic appeal.
Take a look at the design rationale for the new __matmul__ magic method. It's not for the standard library, it's for the community.
But you can also see that Guido has been into types lately. He's been pushing the development of mypy and the new optional type system.
Rails is amazing and I personally love it. But it's not the only thing Ruby is good for.
I dislike the many inconsistencies in Python. You mentioned one. Others: sort vs sorted (destructive vs non destructive). Also: not being able to chain methods because many don't return a value. (Scheme, Elixir or even Ruby are imho much more elegant.)
But all in all Python is a very useful programming language with a rich eco system.
https://docs.python.org/2/faq/design.html#why-doesn-t-list-s...
Nevertheless I find this here much more elegant:
data.sort.tail.first # or this data.append(7).append(3)
More elegant than this:
sorted(data)[1:][0]
data.append(7) # and then
data.append(3)
I love method chaining in Elixir or Javascript. In Python I have to create temp variables here and there to capture / further process intermediate results.
Having said that: Python has it's strengths. I use it more than any other programming language.
if (x=42) {}
Has burned many people. Append having a useful return is comparable, though probably not as much of a trap.> sorted(data)[1:][0]
I don't want to get into the weeds, but shouldn't that just be
sorted(data)[1]
Or if you like unpacking for clarity first, second = sorted(data)[:2]
?Well Perl was the premiere data science language for a while. Python made inroads and eventually took over. I think you're mostly right through, it's just a matter of other factors affecting the communities at the time causing Perl to not grow nearly as quick as Python, and Python getting a good numeric library. Had Perl not lost a lot of community in the early 2000's, it might have retained this area.
Well, Python is the scripting language of a ton of useful libraries which are relevant to a lot of very interesting fields.
R sits in a similar spot, but Python is a better, friendlier language, which means actual programmers are more apt to recommend it as an offhand solution to a simple problem someone who isn't seen as a programmer is having: "Oh, that's easy. Just copy and paste this Python code, and maybe hack at it until it does something." You can get scientists programming with recommendations like that.
https://www.scipy.org/scipylib/building/linux.html
Of course, the people who just install and run SciPy don't need to know that, but the fact Python has a nice C FFI means it can run literally decades' worth of software across a fair number of languages.
My take on the matter is that Python is gaining traction due to its market share of the Data Science/Machine Learning field, which is what's really gaining traction and growing quickly. Had Perl or Ruby been the premier language to use for DS/ML, they would be growing instead of Python.