I've noticed the isinstance() function operating in an unexpected way across project library scripts. I've recreated my issue with a simplified example. I have one script with two classes test.Chair and test.Table. I ALWAYS want the Table.chair attribute to store a Chair object, but I want to allow the developer to input either a Chair object or the 'chairName' string as a parameter to the Table object. To accomplish this I have a method in another module 'testAux' that accepts the 'chair' variable passed into the Table object and checks to see if it is an instance of test.Chair. If it isn't, it will create and return a Chair object with the variable passed as its 'chairName'.

The issue is that isinstance(chair, test.Chair) always returns false. The behavior, therefore, of the getChairObj() function is to instantiate and return a Chair object with another Chair object stored in 'chairName'.
Why isn't the isinstance() function recognizing a Chair object as a test.Chair instance?