J
jamesthiele.usenet
I was looking at Simon Burton's Povray.py code (part of pypov) and saw
this line:
globals()[name] = type( name, (KWItem,), {} ) # nifty![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
where 'KWItem' was a class. It did seem nifty, but it was unclear to me
what was happening.
I went to python.org's online documentation which said that type()
takes one argument. So I fired up python:<class '__main__.x'>
OK, It appears that type() with 3 arguments constructs a class. Is this
documented somewhere? If not can someone explain what is going on?
james
this line:
globals()[name] = type( name, (KWItem,), {} ) # nifty
where 'KWItem' was a class. It did seem nifty, but it was unclear to me
what was happening.
I went to python.org's online documentation which said that type()
takes one argument. So I fired up python:<class '__main__.x'>
OK, It appears that type() with 3 arguments constructs a class. Is this
documented somewhere? If not can someone explain what is going on?
james