Mark English wrote: > The only way I can imagine to do this is to create an instance of the > class in question, and then start poking around in its attributes > dictionary (initially just using dir). So firstly, if there is instead a > way to do this without creating an instance I'd be interested.
This is the only way to go, as python has no attribute declarations as static compiled languages have. But of course not all classes may feature default constructors so that creating an instance is impossible. Or you create unwanted sideeffects - think of the notorious class DeleteMyHarddisk.... As youself already mentioned that maybe you have to impose certain prerequisites, you maybe want to extend this to the point where for each class you want to make dynamically instantiatable you need some declaration. This of course depends on your desired application - whatfor is it planned? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list