. Python 2.1 function attributes

Roy Katz katz at Glue.umd.edu
Sat Jan 27 11:58:06 EST 2001


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?

Roey




More information about the Python-list mailing list