[Python-ideas] "Sum" Type hinting [was: Type hinting for path-related functions]

Greg Ewing greg.ewing at canterbury.ac.nz
Wed May 18 18:41:30 EDT 2016

Guido van Rossum wrote:
> your original remark claimed
> something wasn't syntactic sugar because of the difference between the
> box and its contents, and that's what I disagree with.

Maybe I misunderstood -- you seemed to be saying that
algebraic types were just syntactic sugar for something.
Perhaps I should have asked what you thought they were
syntactic sugar *for*?

I was also responding to a comment that values in
Python are already tagged with their type, so tagged
unions are unnecessary. But the type tag of a Python
object is not equivalent to the tag of an algebraic
type, because the latter conveys information over and
above the type of its payload.


More information about the Python-ideas mailing list