dynamism

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Sep 10 10:00:34 EDT 2002


"Mark McEahern" <marklists at mceahern.com> wrote in
news:mailman.1031660952.2330.python-list at python.org: 

> [Duncan Booth]
>> New style classes (which are those with 'object' or other builtin
>> classes as a base class) do not all allow you to add arbitrary
                                   ^^^
>> attributes: 
> 
> Au contraire:
> 
> $ python
> Python 2.2.1 (#1, Jun 25 2002, 10:55:46)
> [GCC 2.95.3-5 (cygwin special)] on cygwin
> Type "help", "copyright", "credits" or "license" for more information.
>>>> class foo(object):pass
> ...
>>>> f = foo()
>>>> f.x = 1
>>>> f.x
> 1
>>>>

Read what I wrote? The word 'all' was supposed to be a clue.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list