issubclass funny business

Les Schaffer godzilla at netmeg.net
Tue Apr 11 20:40:28 EDT 2000


</F> said:

> how about:
>        if not isinstance(std, StandardArrayFileScanner):

i tried that first, but same problem.

> when you run FileScanner as a script, it's evaluated in the __main__
> namespace.  when you import it, it's evaluated again, in the
> FileScanner namespace.

groan.... its not intuitive (to me). because i can make CIE_Standards
class inherit from FileScanner classes in the udder module no problem
at runtime, so its a surprise to see it won't trace the tree properly
at runtime for isinstance issubclass.

> solution: never import the script you use as the main program.

i am only at the testing stage. neither of these modules will be main
at "usage" time.

les schaffer



More information about the Python-list mailing list