Re: seems like a bug in isinstance()

2011-05-07 Thread Gregory Ewing
dmitrey wrote: Yes, you are right. But I have to do it due to another issue I haven't solved yet: Python3 imports don't see files from same directory http://groups.google.com/group/comp.lang.python/browse_thread/thread/9470dbdacc138709# That's because the syntax for relative imports has ch

Re: seems like a bug in isinstance()

2011-05-07 Thread dmitrey
On May 7, 11:53 am, Gregory Ewing wrote: > Chris Rebert wrote: > > This is because you did `from Point import > > ...` in file2.py, whereas in file1.py you did `from > > openopt.kernel.Point import ...`. These 2 different ways of referring > > to the same module are sufficient to "trick"/"outsmart

Re: seems like a bug in isinstance()

2011-05-07 Thread Gregory Ewing
Chris Rebert wrote: This is because you did `from Point import ...` in file2.py, whereas in file1.py you did `from openopt.kernel.Point import ...`. These 2 different ways of referring to the same module are sufficient to "trick"/"outsmart" (C)Python and cause it to import the same module twice

Re: seems like a bug in isinstance()

2011-05-06 Thread Ian Kelly
On Fri, May 6, 2011 at 4:20 AM, dmitrey wrote: > Thanks Cris, however, I had understood reason of the bug and mere > informed Python developers of the bug to fix it. No you haven't. Few if any Python developers make a habit of reading this newsgroup. To actually report the issue so that it migh

Re: seems like a bug in isinstance()

2011-05-06 Thread dmitrey
On May 6, 12:57 pm, Chris Rebert wrote: > On Fri, May 6, 2011 at 2:24 AM, dmitrey wrote: > > hi all, > > > suppose I've created a class Point in file .../openopt/kernel/Point.py > > > Consider the code in file .../somewhere/file1.py > > from openopt.kernel.Point import Point > > p = Point() > > >

Re: seems like a bug in isinstance()

2011-05-06 Thread Chris Rebert
On Fri, May 6, 2011 at 2:24 AM, dmitrey wrote: > hi all, > > suppose I've created a class Point in file .../openopt/kernel/Point.py > > Consider the code in file .../somewhere/file1.py > from openopt.kernel.Point import Point > p = Point() > > now let's pass p into a func from .../openopt/kernel/f