[Python-ideas] PEP 484 (Type Hints) -- first draft round
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon Jan 19 21:28:56 CET 2015
> On 1/18/2015 10:40 PM, Guido van Rossum wrote:
>
> > Very few people subclass builtins.list ...
> > So perhaps Cython could just assume that typing.List means
> > builtins.list and (dynamically) reject calls that pass a subclass
> > of builtins.list?
That's actually a reasonable idea. Anything that accepts
something as weird as a trianglular matrix implemented as
a list subclass will probably accept any kind of sequence,
so you might as well type it as Sequence (or whatever the
abstract sequence interface is to be called).
--
Greg
More information about the Python-ideas
mailing list