Are there any PEPs for typed arguments?

Eugene importbinascii
Sun Dec 2 16:59:27 EST 2001


> Are you claiming that "meth" would not work correctly if I passed a
> small long for "a" or that I could not use a instance that supports
> __getitem__ (that always returns a length 1 string), __len__ and a few
> other string methods for "b"?
>
> So why restrict the use of compatible types?

What checks would you do to determine if a variable could be converted to an
int without changing its value?

And what checks would you do to safely determine if an object implements all
the methods you want it to?  If it does implement all those methods, what
assurance do you have of what the methods' return-types will be?

Supporting compatible types is a good thing, but so is determining at the
_start_ of a function that something is going to break because a contract
(or an assumption) was not upheld.

    -Eugene





More information about the Python-list mailing list