reloading modules and isinstance()
Diez B. Roggisch
deets at nospam.web.de
Wed Dec 5 08:25:01 EST 2007
Steven D'Aprano wrote:
> On Tue, 04 Dec 2007 15:41:48 +0100, Diez B. Roggisch wrote:
>
>> You just discovered one reason why reload() is a bad idea and IMHO
>> shouldn't be used at all - as tempting it might be.
>
>
> I disagree -- I find reload() extremely useful for interactively testing
> modules. But I would never dream of using it in production code!
I find short scripts I write & start on the commandline much more helpful -
and if I need interactivity, throwing in a
import pdb; pdb.set_trace()
or
python -i <script>
do what I want. But I certainly don't have time to hunt down bugs introduced
by reloading in the first place...
YMMV - and it seems it does :)
Diez
More information about the Python-list
mailing list