This blog is now hosted at consciou.us

Thursday, March 20, 2008

More Python

Some more thoughts on Python...

The fact that there don't seem to be any adjectives in the language is a bit wierd: as a Perl programmer, I'd expect to be able to declare a variable as local (I go back to Perl 4) or my, but nothing equivalent in python.

Declaring static methods is wonky, but at least they are there, so I can make Singletons.

For those of you who haven't read Design Patterns, a Singleton is a way to implement classes that you only load once. For instance, when the startup costs for the object are very expensive. In my case I'm doing a dozen or so nasty, full table-scan (on hundreds of thousands or millions of rows) SQL queries. You might guess I want to do this as few times as possible. :)

Anyhow, the lambda expressions and first class functions more than make up for it. Very nice.

No comments: