[Python-ideas] Mention of "Sum" considered harmful [was: "Sum" Type hinting]

Stephen J. Turnbull stephen at xemacs.org
Tue May 17 03:03:26 EDT 2016


Koos Zevenhoven writes:
 > On Mon, May 16, 2016 at 2:37 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
 > >
 > > I'm not deeply into category theory, but the proposal
 > > seems to be that Sum would be a special kind of type
 > > that's assumed to be the same type wherever it appears
 > > in the signature of a function.
 > 
 > Indeed, that's TypeVar.

True as far as the statement itself makes sense (categorically, a type
is what it is, so of course it is the same type wherever it appears!),
but a Sum would not be a TypeVar.  It's a type, it's far more
limited[1] in analyzing Python programs, and I would like to withdraw
the term itself, as well as any proposal to add it to typing, from
this discussion.

All concerned have my apologies for bringing it up at all.


Footnotes: 
[1]  And useful in category theory for that very reason -- it's easier
to reason about in categorical contexts.  But it makes things harder
in Mypy.




More information about the Python-ideas mailing list