Classes loading using script console cause isinstance to return False

We have upgraded from 8.1.10 to 8.1.17 and we are see a difference in the way the script console is loading files/classes.

Here is an example

image

image

It appears that the testClass.TestClass is getting loaded twice with two different ids. Once when the console starts and then again when I access the property on TestClass2 which references TestClass.

Any help on this would be great. This does not seem to be a problem when running the code in a client only a problem in the script console.

Any ideas on this? It would really be nice to use the console to do quick code tests rather than having to go over to the client. We are now on 8.1.18 and this problem still exists.