[Python-Dev] Adding NewType() to PEP 484

Stephen J. Turnbull stephen at xemacs.org
Sat May 28 14:46:10 EDT 2016
Guido van Rossum writes:

 > But seriously I think we should just decide between Derived Type and
 > Distinguished Type [Alias].

I like "typedef", but I'm pretty sure it wouldn't carry the same
connotations to people who aren't C programming oldtimers.

I dislike "derived" because that fits stuff like Union[int, str] or
List[int] *better* than NewType("A", int).

Bottom line: +1 for distinguished.

I may have a little trouble remembering that NewType creates
Distinguished Types (do they get a medal from the Queen, by the way?),
but if you call something a "distinguished type" I will have zero
trouble remembering that it's a new type created out of thin air by
distinguishing it from an existing type.



More information about the Python-Dev mailing list