Posts

Showing posts from April, 2008

"raise" becomming a function in py3k?

Over on the voidspace blog, there is a little discussion about raising an exception in a lambda.

Because raise is a statement, it's kind of a hard thing to do. Raising an exception as an expression that is.

Which "raises" the question, why isn't raise a function in py3k?

The two suggestions on how to raise in an expression were these:
>>> r = lambda: eval(compile("raise RuntimeError", '', 'exec'))
>>> r()

>>> ctypes.pythonapi.PyErr_SetObject(*map(ctypes.py_object, (e.__class__, e)))

Which are kind of both a bit yuk.

So maybe raise could be a bit more expressive in py3k?

Bars in Beijing?

A friend of mine who lives in Beijing has set up a website categorising all the Bars in Beijing.

It's still a work in progress, but he has listed over 500 bars so far. For a place as big as Beijing, you can imagine that there's going to be a lot of bars. They're categorised by location, and if they are a night club, a bar, or a KTV(karaoke) place etc.

He still wants to add photos for all of the bars, and just generally make it a nice guide to Beijing bars.

Ludumdare 48h game development competition this weekend.

Image
For those that didn't have time for pyweek (like me) - there is the ludumdare game development competition.

The ludumdare competition is similar to pyweek - it's what inspired pyweek.

The main differences are it's more "from scratch", it is only one weekend, and you have to do everything yourself - no teams. Also you can use any language - not just python, and everyone can select themes over three voting rounds.

The main idea is that One has to do all parts of game development - art, coding, sound, music etc, and to concentrate on the design of the game - rather than building engines. So it's a short burst of creativity, and junk food eating - with around 100 other people at the same time making their own games.


(img by MrFun).


LD 11 :: Weekend of April 18-20 - Currently doing round 2 of theme voting.

database ORM adaptors?

Are there any adaptors for the various python database ORM models?

For example SQLObject <-> Storm <-> mother ORM <-> django ORM <-> SQLAlchemy <-> GeniusSQL, etc.

It seems this might be a good way to reuse some models, and code for those models.

For example, say there was a SQLAlchemy <-> Django ORM adaptor, then pylons, django, and turbogears could more easily inter operate.

Then if an adaptor for SQLObject <-> SQLAlchemy was made SQLObject could then use the SQLAlchemy <-> django ORM adaptor.

I guess at this point, sharing at the database level makes more sense.


update: http://code.google.com/p/django-sqlalchemy/ seems to be a work-in-progress "project to create SQLAlchemy mapping of Django models onto a SQLAlchemy backend".

Being proactive with bugs - search, not categorise.

I like to search for bugs, not so much wait for them to be reported in one specific way. Here's a story to illustrate what I mean.

As part of a new pygame release we've been improving the pygame bug reporting, and fixing system.

The old(and current) system used the mailing list as a bug reporting system. We still use this system, but have added a few other methods. People simply report bugs and patches to the mailing list. Then developers search through the mailing list, and noted when they were fixed, on the mailing list. Because the pygame mailing list is quite large often a lot of people would view, review and fix the bugs. It also informs people how to report a bug - because people on the mailing list see it happening every now and then.

Having bugs in the mailing list is nice, because I can type BUG into my mail programs search function to find bugs. Or I can type PATCH to find patches. Or I can have my program filter emails with bug, patch from specific mailing list…