instanceof tag

2 questions


1 answers
154 views
0
Instanceof and Class.isAssignableFrom(…)What's the difference?

a instance of B Me B.class.isAssignableFrom(a.getClass())The difference I know in is that if a is null, instanceof returns false, and isAssignableFrom drops exception. Other than that, are they all th...

2 years ago

1 answers
114 views
0
Find the class name from the instance

Is there a way to find out the class name of the instance in Python?I thought I could use the inspect module, but I couldn't find it.


© 2024 OneMinuteCode. All rights reserved.