News for hackers. Stuff that matters.
Re:Hidden features of Python - Stack Overflow by bmastenbrook on Sunday January 23, 2011 @02:38PM (#2133131)
Hidden features in a programming language? Granted, most of these aren't "hidden", but they're nonobvious because the language is incredibly complex and it's difficult to predict from first principles that any of these things would actually work.

Long ago, a rule of programming language design was handed down by the great old hackers, but it has been forgotten and much needless effort has been spent as a result. It's time to remind language designers of the rule again:

"Programming languages should be designed not by piling feature on top of feature, but by removing the weaknesses and restrictions that make additional features appear necessary."

Re:Hidden features of Python - Stack Overflow by eru on Sunday January 23, 2011 @03:19PM (#2133222)
Some of those features are just some fancy libraries, or syntactic sugar that you can ignore, if you want to. They don't make the language itself more complicated.
Re:Hidden features of Python - Stack Overflow by narm60 on Sunday January 23, 2011 @04:28PM (#2133380)
Can you go into specifics about how any of these examples are non-obvious because the language is incredibly complex?

In the context of higher level and or dynamic languages, I'd argue that Python is rather low on the complexity scale

Re:Hidden features of Python - Stack Overflow by eru on Monday January 24, 2011 @04:52AM (#2134777)
Yes, and some of those `hidden features' are just nice library functions that avoid adding features to the core language. Look at `enumerate' and `zip' for example, which allow Python to get away with one very simple for-loop.
Re:Hidden features of Python - Stack Overflow by j_baker on Sunday January 23, 2011 @10:11PM (#2134100)
I think Guido is well aware of that rule, and makes a conscious effort not to add unnecessary features to the language. Still, there's no way you can maintain any non-trivial piece of software for 20 years and not have a few unexpected "features" come up.