accessing a classes code

John Machin sjmachin at lexicon.net
Wed Apr 19 19:55:24 EDT 2006


On 20/04/2006 6:54 AM, bruno de chez modulix en face wrote:
>> It turns out that what I want to do can be done using the inspect
>> module which has methods for getsourcecode among other things.
> 
> I never said that what you wanted to do was impossible (nor even
> difficult, and FWIW, there are simpler alternatives than using inspect
> - using a templating system like empy comes to mind...). I only suggest
> that there are possibly far better solutions, that you seem to dismiss
> for some unknown reason...
> 

I'm with bruno -- IMHO, the OP's "solution" seems Byzantine, bizarre, ...

Suggestion: the initial investigator gadget writes out the discovered 
parameters into a case-specific config file, whose name is later passed 
as an arg to the [only one] class's __init__ method()



More information about the Python-list mailing list