Are You a Pythonista?

While browsing Daily Python-URL this morning (for work, of course :), I found a thread posted on comp.lang.python titled "You know you're a Pythonista when...", which is quite interesting. Having used Python as my main programming language for the past two and half years, I am afraid that I might still fail the test... Anyway, here's some of the highlights.

Bookmarking the Language Reference Index and realizing that "for language lawyers" applied to *me* (my links for "Extending and Embedding" and "Python/C API" are still blue).

Well. I have mainly used the Library Reference, and I occasionally use "Extending and Embedding" part of the reference when I try to hack the C code together for Python, but I hardly use the Language Reference. Why do I need to refer to the reference of a language that is so clean and unambiguous? You know that you need the reference on the language itself when you are hacking away with Perl and C++...

Relying on unittest.

Well. I know that I should rely on unittest. I know that I *should*.

Discovering filter() and map().

Someone came up with a better one later on...

Discovering list comprehensions and then dumping filter() and map().

This is exactly what I did! When I started using Python, I have filter, map and lambda all over the place, but now I found it is easier and faster to wrack up a list comprehension that does the same thing. However, I still love lambda, which gives you an anonymous function that resembles functional programming. And also the elite status that comes with that :)

When you insist on using

    this.attribute
  

in your Java and C# code, and

    this->attribute
  

in your C++ code.

When you declare a private method/attribute in the above languages prefaced by double underscore:

    private int __myint;
  

And this is exactly what I have done as well! According to the Zen of Python, it is better to be explicit than implicit, and the usage of self or this is very much explicit, which I think helps a lot when I browse the code. By looking at it, I know exactly whether this is an instance variable. Very very handy. And not just in Java and C++, now I prefix variables with underscores to indicate that, hey, it is a private variable - don't abuse it!

You use the interactive interpreter as a calculator.

Yup. Done that one. Whenever I need to do some calculation in front of my computer, instead of running calc.exe or other GUI based calculators, I just fire up a shell and type python...

Well. Going back to more Python (and some Javascript for today) hacking...