Re: Hard times with packages and instances

2005-05-06 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > > if you manage to import the same thing multiple times, you'll have > > > multiple class objects representing the same source code, and is- > > > instance won't work properly. > > > > Importing a class/module multiple times does not cause the proble

Re: Hard times with packages and instances

2005-05-06 Thread Fredrik Lundh
Kay Schluehr wrote: > > if you manage to import the same thing multiple times, you'll have > > multiple class objects representing the same source code, and is- > > instance won't work properly. > > Importing a class/module multiple times does not cause the problem. > Writing > > import ForeignP

Re: Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > I wonder why the isinstance() function is sensitive about the import > > path i.e. the result depends not only on the class and the instance but > > also on how a class is imported? > > isinstance uses class object identity. > > if you manage to impo

Re: Hard times with packages and instances

2005-05-05 Thread Fredrik Lundh
Kay Schluehr wrote: > I wonder why the isinstance() function is sensitive about the import > path i.e. the result depends not only on the class and the instance but > also on how a class is imported? isinstance uses class object identity. if you manage to import the same thing multiple times, yo