. Python 2.1 function attributes

Rainer Deyke root at rainerdeyke.com
Sat Jan 27 18:09:43 EST 2001


"Roy Katz" <katz at Glue.umd.edu> wrote in message
news:Pine.GSO.4.21.0101271156550.3501-100000 at y.glue.umd.edu...
> On Sat, 27 Jan 2001, Rainer Deyke wrote:
>
> > Syntax sugar for singletons could chop another line from the class-based
> > idiom:
> >
> >
> > singleton g:
> >   attr = 0
> >   def __call__(): pass
>
>
> I thought of that, so I wrote the other post (about an Entity type).
> I noticed that your __call__() doesn't pass self.  Was this intentional,
> given that  you specified a singleton?

No, I just forgot to put 'self' in the argument list.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list