
Hidden features of Python - Stack Overflow - dpatru
http://stackoverflow.com/questions/101268/hidden-features-of-python/102062
======
jedsmith
Dupe of:

\- <http://news.ycombinator.com/item?id=1512930>

\- <http://news.ycombinator.com/item?id=594210>

I don't mind being reminded to see if there's anything new, though.

~~~
dpatru
I've seen it here before, but yesterday I happened to stumble across it again,
learned something new, and figured maybe other people on HN would benefit from
it too.

------
bmastenbrook
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."

~~~
narm60
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

~~~
eru
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.

------
nbpoole
Obligatory XKCD: <http://xkcd.com/353/>

~~~
silentbicycle
XKCD is _never_ obligatory.

Seriously, why is anyone "obligated" to post a comic that mentions Python, but
adds nothing of substance, and isn't even funny?
([http://www.google.com/search?q=site%3Anews.ycombinator.com+%...](http://www.google.com/search?q=site%3Anews.ycombinator.com+%22obligatory+xkcd%22))

~~~
j_baker
Let's be fair. It was funny the _first_ time I saw it.

~~~
silentbicycle
Damning with faint, faint, faint praise.

ObPython: Learn Smalltalk too!

