[Python-3000] PEP 3100 Comments

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Sun May 7 23:01:59 CEST 2006


Talin <talin at acm.org> writes:

> How about instead of 'callable', an "isFunction' test to go along
> with 'isSequence' and 'isMapping'. (You aren't getting rid of those -
> I hope...?)

Such predicates, unless backed by some explicit or strict criterion
like isinstance, are as suspicious for me as checking function arity.
They don't survive generic wrappers.

What would isFunction exactly mean?

IMHO duck typing makes sense only if it's not used to discriminate
what interfaces the given object supports, but only to provide an
already expected interface. In order to declare that an interface
is supported and to be able to recognize it, subtyping is better.

Unfortunately it must be decided early that the given interface
should be discoverable by subtyping.

-- 
   __("<         Marcin Kowalczyk
   \__/       qrczak at knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/


More information about the Python-3000 mailing list