4 ms·
The type (class really) of an object tells you nothing about how it will behave. What you need to do is check the methods attached to the object, not class, at
by antt 8y ago
The type (class really) of an object tells you nothing about how it will behave. What you need to do is check the methods attached to the object, not class, at runtime:
1) Exist.
2) Behave how you want them to behave.
I've written plenty of code that got that done by using an assert just after the docstring.
People will monkey patch, if not in your code base, than in a library you're importing.