Behaviour-based interface/protocol implementation?

Alan Franzoni mailing at franzoni.eu
Thu Jan 27 14:05:19 EST 2011


On Thu, Jan 27, 2011 at 8:03 PM, Alan Franzoni <mailing at franzoni.eu> wrote:
> Yes, __instancecheck__ could be used as an alternative hook with
> respect to maybe_implemented_by(), but there's no such logic for
> signature checking. That's a minor detail, I think.

On the contrary, now that I double checked, it can't be used that way;
I don't want to modify the object I'm testing (it could be a third
party object) nor I want to force it to be "registered" as a certain
ABC; so __instancecheck__() is just useless here.


-- 
Alan Franzoni
--
contact me at public@[mysurname].eu



More information about the Python-list mailing list