Get dictionary-keys used to format a string

Moshe Zadka moshez at math.huji.ac.il
Thu Mar 2 14:32:54 EST 2000


On Thu, 2 Mar 2000 cgw at alum.mit.edu wrote:

> class KeyKeeper:
>     m=Malleable()
>     def __init__(self):
>         self.keylist=[]
>     def __getitem__(self,key):
>         self.keylist.append(key)
>         return m
NameError: m

Change this to self.m, and you're in business

--
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.





More information about the Python-list mailing list