A collection of articles, ideas, and rambling from a guy who wrote some software that one time.

Wednesday, June 22, 2005

Wednesday, June 15, 2005

metaclasses: like candy for sociopaths

If you've ever tried to use __slots__, you might have noticed that it comes with a pleasant side-effect: it makes it impossible to assign extra, garbage attributes to your objects. While normally not a serious problem, objects with extra, unintentional crud stuck to them can make object databases hell to work with as you struggle to figure out where it came from or why it is in your database but not in memory. Therefore, this semantic feature is handy in addition to reducing the memory footprint of objects if you have large numbers of them lying around.

If you've noticed this, you've also probably noticed that it is damn near impossible to use __slots__ because you have no control over what slots are used from your base classes.

Here is a solution to this problem that I have been working on for a while: SlotMachine. While it breaks isinstance - you weren't using isinstance anyway, right? - it does do the sane thing that you would expect a cooperative __slots__ implementation to do; you can subclass from random other classes (provided that you properly specify all their attributes as slots on your object) and other SlotMachines, and even other objects that define __slots__, without giving up the explicit specification of attributes or the ability to inherit from things.

I'll add some more comments to that file later tomorrow, I think.

Tuesday, June 14, 2005

Releasery

We managed to release something yesterday - Pyflakes, a tool similar to PyChecker but about a zillion times faster and provides fewer useless warnings. The author is Phil Frost, one of our developers and the lead maintainer of the Unununium OS project. Pyflakes was previously available through his home page, but we've started hosting it on divmod.org in the hopes that it can get some wider exposure and use and raise the average index of Python code quality throughout the universe.

math is for nerds

Can you guess what this is?



Posted for the benefit of Mr. Mesozoic

Saturday, June 04, 2005

Where Have All the Hobos Gone

Time was, not too long ago, that you couldn't swing a dead cat around in #twisted without hitting some vastly overqualified unemployed bum. Doing a little poking around I am surprised to find that this is no longer the case.

I've been referred a number of jobs, most in the NY/Boston area but a few out on the left coast, that involve Python and Twisted (and some PyWin32) work, and I haven't found any qualified people yet.

If you are around one of those areas or willing to telecommute or relocate, please drop me a line.

No Seriously

I just found out that there is a class at UCLA that uses Twisted as part of its curriculum. Even better, this class is apparently taught by Paul Eggert, of Bison (and other free software) fame.

I don't even know what to say about this.

Wednesday, June 01, 2005

Thanks Everyone

As predicted, members of my family and various friends were better to me than I deserve on my birthday.

I have yet to figure out exactly which features to fund, but I think that I'm going to be giving out small prizes, probably in $20US increments, for each one. For those of you across the puddle, that's about €0.02 at a time - but it's still enough to buy dinner over here.

Thanks to everyone who sent a donation in, and thanks especially to Kim, who trudged up to Boston and helped contain the hellmouth in my apartment.
(As any ADD sufferer will testify, piles are the enemy. When one's cohabitant has an entire house and 3 whole lifetimes worth of stuff to pile up, the piles can set you up for a crushing and continuous defeat, which is definitely no good for one's mental health, creating a feedback loop where one is discouraged or even afraid to organize things.)
Kim defeated even the piles which we had made an uneasy truce with, the ones which we had actively tried to clean up before and had been resigned to treat as simply a messy storage solution rather than a problem. With the piles trapped and cornered, the floors are walkable and the surfaces usable. Who knew that using a vacuum cleaner could be so much fun?