Archive for the ‘python’ Category

Mutable class instance variables in Python act like they’re static

Thursday, May 29th, 2008

There's a weird behavior in Python when dealing with Mutable types such as dictionaries, that when you modify a variable defined as a class attribute, you're actually modifying a shared dictionary amongst all the classes. This seemed weird to me. You can read the lovely discussion about it, ...

Getting phpsh to work on a mac

Tuesday, December 18th, 2007

I had an issue getting phpsh to work on my mac - I kept getting the following error: Traceback (most recent call last): File "./phpsh", line 20, in import readline OK, seems easy enough. So I compiled python with readline support. ./configure --prefix=/usr/local/python --enable-readline I change the ...