Archive for the 'pygr' Category

__getattr__ Considered Harmful

Monday, August 4th, 2008

I just refactored a number of internal aspects of Pygr’s object-relational model, to make use of a new pattern I’m calling “subclass binding”, which I’ll try to explain a bit in this post.  First I’ll try to explain the problem from the viewpoint of a Python programmer.

Object-relational design makes modularity even more difficult than usual. It illustrates a general problem: when you try to combine two different behaviors (e.g. a local Python object and a back-end database) into one object, all sorts of confusion can ensue.

(more…)

Pygr.Data in A Web Browser!

Monday, November 26th, 2007

I’ve been hacking a bit with Silverlight, Microsoft’s environment for running dynamic languages like Python and Ruby directly within a web browser like Firefox or IE. It seems to work quite well, and it’s easy to get Python code up and running in Silverlight. Indeed, it’s been surprisingly easy to get quite significant chunks of Python running in Silverlight — specifically, pygr, including large portions of code originally written for Pyrex (a mixed C / Python language environment). First I’ll describe my impressions of Silverlight and its implications for Python, then what I’ve accomplished with it.

(more…)