Fix Python – How to decorate a class?

How do I create a decorator that applies to classes?
Specifically, I want to use a decorator addID to add a member __id to a class, and change the constructor __init__ to take an id argument for that member.
def getId(self): return self.__id

classdecorator addID(cls):
def __init__(self, id, *args, **kws):
self.__id = id
self.g….

Fix Python – What does from __future__ import absolute_import actually do?

I have answered a question regarding absolute imports in Python, which I thought I understood based on reading the Python 2.5 changelog and accompanying PEP. However, upon installing Python 2.5 and attempting to craft an example of properly using from __future__ import absolute_import, I realize things are not so clear.
Straight from the changelog….