Cool object trick

Nick Coghlan ncoghlan at iinet.net.au
Sat Dec 18 23:15:44 CET 2004


Robert Brewer wrote:
> Bengt Richter wrote:
> 
>> >>> m=type('',(),{})()
>> >>> m.title = 'not so fast ;-)'
>> >>> m.title
>> 'not so fast ;-)'
> 
> 
> Now THAT is a cool object trick. :)

Heh.

Look ma, Perlython!

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list