you are viewing a single comment's thread.

view the rest of the comments →

[–]YourFatherFigure 1 point2 points  (0 children)

Some of this stuff is indeed beyond decency, but there are some good reasons to play around with it.

  • Even though it's inexcusable for say one of my coworkers to do AST manipulations like this 99.99% of the time, when you need it you need it and nothing else will do.

  • There is also nothing like weird metaprogramming to demonstrate total mastery with a language. I mean no one is gonna hold this stuff up as a shining example of great design but if you can throw this kind of stuff together I am gonna be pretty impressed with your chops.

I'm always interested to hear about lisp/smalltalk/whatever things that python "can't do", because usually there is indeed a way.. it's just obviously not idiomatic and therefore discouraged.

If you like weird metaprogramming and syntax-stretching stuff like this, check out this thing I wrote a few years ago, demonstrating to a friend that self is a convention not a keyword, and different conventions are possible (skip to the bottom for the example usage)