Get dictionary-keys used to format a string

Moshe Zadka moshez at math.huji.ac.il
Thu Mar 2 20:32:54 CET 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