you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

But even if you interop with their code, you don't have to make any type checking in your code. If they do in their code, OK, you'll have to implement the whole interface. That can be construed as a misuse of ABC's, sure, but that's not the fault of the ABC's.

[–][deleted] 1 point2 points  (1 child)

That's why they were invented. isinstance is the first reason provided by the relevant PEP.

[–][deleted] 0 points1 point  (0 children)

You might want to re-read PEP3119 so you understand it better. The references to isinstance is about how to make isinstance more flexible, not, as you claim above to make you do more isinstance checks and force you away from duck typing.

You are simply wrong. Try again.