Skip to content.

plope

Personal tools
You are here: Home » Members » chrism's Home » Unpythonic == Obscene » Change is unpythonic
 
 

Comment

Above in this comment thread: Unpythonic == Obscene » Python was simple » what's not simple now?

Change is unpythonic

Posted by morphex at 2005-11-08 12:36 AM
For me, I think code that's hard to read and hard to do one way is unpythonic, as python had a good design that I certainly got used to using in a certain way. Using map, filter, lambda and so on to handle sequences is something I've grown accustomed to.

Seeing list comprehensions like this for example

print [(i,f) for i in nums for f in fruit if f[0] == "P" if i%2 == 1]

doesn't remind me of anything pythonic. That should be block of code, not a one-liner.. having several if statements on one line does not make it more readable IMO.. It's also not good that there are changes to the language that deprecate certain features - sure, the old features will go away some day, but when? How long will we have multiple ways of doing something? And what happens to the promise that Python will be backwards compatible? Do we end up with one big ball of mud, like lisp?

1131549788

That kind of rope has been available in python since the 90s, though. You should see some of the programs I wrote back then, when I was still learning.

The fact that a language feature can be used badly in unskilled doesn't count much against it, in my book. If it <i>rewards</i> bad practices, that's a much bigger deal. But a language can only go so far to protect programmers from themselves before it starts to get in the way of legitimate efforts.