Get dictionary-keys used to format a string

Moshe Zadka moshez at
Thu Mar 2 20:32:54 CET 2000

On Thu, 2 Mar 2000 cgw at 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>. 
INTERNET: Learn what you know.
Share what you don't.

More information about the Python-list mailing list