uses http://dumpz.org/653/

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
>>> person = Person(datetime(1954, 1, 25))
>>> person.born
datetime.datetime(1954, 1, 25, 0, 0)
>>> person.age
54
>>> person.born = datetime(1968, 8, 31)
>>> person.age
40
>>> person.age = 16
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'> Traceback (most recent call last)
C:\Documents and Settings\murkt\<ipython console> in <module>()
<type 'exceptions.AttributeError'>: can't set attribute