Re: [Tutor] Trying to avoid using eval..

2013-02-23 Thread Peter Otten
Rohit Mediratta wrote: >I want to reload my Module after I fix bugs and want to instantiate an >object of a class contained in this module. Just a warning about reload(), as your question was already answered: Reloading modules may seem convenient at first, but can lead to strange error

Re: [Tutor] Trying to avoid using eval..

2013-02-22 Thread eryksun
On Fri, Feb 22, 2013 at 9:11 PM, Rohit Mediratta wrote: > Heres the pseudo code of what I want to do: > > def rerun(testBlock) : > op = testBlock.split('.') > module = op[0] ; className = op[1] > reload(module) > # testBlock is a string, so it needs evaluation! > newObject = te

Re: [Tutor] Trying to avoid using eval..

2013-02-22 Thread Steven D'Aprano
On 23/02/13 13:11, Rohit Mediratta wrote: Hi All, I want to reload my Module after I fix bugs and want to instantiate an object of a class contained in this module. Heres the pseudo code of what I want to do: def rerun(testBlock) : op = testBlock.split('.') module = op[0] ; clas

Re: [Tutor] Trying to avoid using eval..

2013-02-22 Thread Mitya Sirenef
On 02/22/2013 09:11 PM, Rohit Mediratta wrote: Hi All, > I want to reload my Module after I fix bugs and want to instantiate an object of a class contained in this module. > > Heres the pseudo code of what I want to do: > > def rerun(testBlock) : > op = testBlock.split('.') > module = op[0] ; c

[Tutor] Trying to avoid using eval..

2013-02-22 Thread Rohit Mediratta
Hi All, I want to reload my Module after I fix bugs and want to instantiate an object of a class contained in this module. Heres the pseudo code of what I want to do: def rerun(testBlock) : op = testBlock.split('.') module = op[0] ; className = op[1] reload(module) # testBloc