[issue12203] isinstance not functioning as documented

2011-05-29 Thread Joesph
Joesph someone...@gmail.com added the comment: And much sense is made. If there is a generic instance test that I have missed I'd be willing to work around this minor flaw. That the definition is an instance of 'object' is a case that should be handled by the function though. On May 28, 2011

[issue12203] isinstance not functioning as documented

2011-05-29 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Everything in python is an instance of something. Objects all the way down... isinstance(object, object) True So, there is no function you are overlooking because there is nothing that is not an instance. -- nosy:

[issue12203] isinstance not functioning as documented

2011-05-29 Thread Joesph
Joesph someone...@gmail.com added the comment: It only fails when checking for 'object'. To think classes are instances is absurd. Its like saying the chicken is the egg. I can understand that classes are an instance of object in the interpreter, but, that isn't the case in the interpreted. Thus

[issue12203] isinstance not functioning as documented

2011-05-29 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: You are correct, B is not an instance of A. But both B and A are instances of 'type': class A: ... pass ... class B(A): ...pass ... isinstance(A, type) True isinstance(B, type) True And type is a subclass of object.

[issue12203] isinstance not functioning as documented

2011-05-29 Thread Joesph
Joesph someone...@gmail.com added the comment: Beautiful, thank you. This should be in the isinstance documentation for clarity. On May 29, 2011 9:28 PM, R. David Murray rep...@bugs.python.org wrote: R. David Murray rdmur...@bitdance.com added the comment: You are correct, B is not an

[issue12203] isinstance not functioning as documented

2011-05-28 Thread Joesph
New submission from Joesph someone...@gmail.com: #Example: class a(object): pass b = a() print([isinstance(a,object), isinstance(b,object)]) ''' outputs: [True, True] expected: [False, True] As class a is not instantiated it should return false. As-is isinstance is just a synonym for

[issue12203] isinstance not functioning as documented

2011-05-28 Thread Alex Gaynor
Alex Gaynor alex.gay...@gmail.com added the comment: I don't see why this is incorrect, type(a) - type, and object is a superclass of type. -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12203

[issue12203] isinstance not functioning as documented

2011-05-28 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Everything is an instance of object. -- nosy: +benjamin.peterson resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12203