[Tutor] __setattr__ for dictionary???

Runsun Pan runsun@bilbo.bio.purdue.edu
Sat Nov 9 17:35:01 2002


hi i'm trying to use the __setattr__ to do some
data check before they are stored into my class.
I've learned :

def __setattr__(self, nsmr, value)

how do i use that to do a data check on the entry of
a dictionary item?

For example, a dict: 

peoplename={'last':'Lee', 'first':'john'}

how do i use the __setattr__ for it ?

thx



-- 
 ========================================
 --->  Be like water, be shapeless   <---

 Runsun Pan, PhD 
 Ecology & Evolution, U. of Chicago
 ========================================