Am Donnerstag 04 Mai 2006 01:04 schrieb Martin P. Hellwig:
> Because of:
> >>>> id = IDGenerator("01",99)
> >>>> id()
> >
> > Traceback (most recent call last):
> >   File "<pyshell#1>", line 1, in ?
> >     id()
> > TypeError: 'IDGenerator' object is not callable
>
> But i do appreciate your comment, thanks!

You need to define a __call__(self)-method on your class so that instances are 
callable... Basically, what Bruno was saying, is that you rename your 
__repr__(self) to __call__(self), and see what happens.

--- Heiko.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to