4 ms·
There are probably 10-15 things that really bother me about python, but none of them are in this list. This list is really pretty darn awful. My biggest issue
by JoelMcCracken 16y ago
There are probably 10-15 things that really bother me about python, but none of them are in this list. This list is really pretty darn awful.
My biggest issue with python is its stupid tendency toward imperative programming in the standard library. For an instance of this irritation, try running python, then executing dir(<any object you pick>). Then, try dir(<obj>).sort . Notice anything? Yeah, the f'er sorted it in place, and didn't return anything. Nice job, library.
I once tweeted that python was a c programmers version of lisp, and ruby is a lisp programmers version of c, and the more time I spend working with both languages, the more I am convinced of the truthfulness of this statement.
- aston 16y agoThe reason .sort() doesn't return anything is because it sorts in place. That way you won't get confused between the returned list and the sorted one. Maybe you're looking for sorted(dir(<obj>)), which gives back a new list?
- viraptor 16y agoReminds me of "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" Sort sorts in place. It's documented.