[Python-ideas] PEP 484 (Type Hints) -- first draft round
Chris Barker
chris.barker at noaa.gov
Mon Jan 19 08:04:51 CET 2015
On Sun, Jan 18, 2015 at 10:06 PM, Terry Reedy <tjreedy at udel.edu> wrote:
> Storing a triangular matrix in a list, with __getitem__ calculating the
> linear index from an input row, col pair, is another possible example.
>
well, I prefer do do this sort of thing with a "has a" relationship,
anyway, which would work better. Particularly if you are changing the API
of get_item....
So we may be OK.
> > 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?
>
> Identifying a triangular matrix as a List might not be too useful in any
> case.
>
exactly.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150118/ba472882/attachment-0001.html>
More information about the Python-ideas
mailing list