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

2016-06-01 Thread Guido van Rossum
I've merged this into PEP 484 now. The informal term used there is actually "unique type" which is fine. End of discussion please. On Wed, Jun 1, 2016 at 5:50 PM, Bernardo Sulzbach wrote: > On 06/01/2016 09:44 PM, Guido van Rossum wrote: >> >> Everyone on the mypy team

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

2016-06-01 Thread Bernardo Sulzbach
On 06/01/2016 09:44 PM, Guido van Rossum wrote: Everyone on the mypy team has a different opinion so the search is on. :-( On Wed, Jun 1, 2016 at 5:37 PM, Hai Nguyen wrote: I am +1 for DistinctType (vs others) (no specific reason, just read out loud). At least on this

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

2016-06-01 Thread Hai Nguyen
I am +1 for DistinctType (vs others) (no specific reason, just read out loud). Hai On Wednesday, June 1, 2016, Guido van Rossum wrote: > Unless Jukka objects I am going with "distinct type" when discussing > the feature but NewType() in code. > > -- > --Guido van Rossum

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

2016-06-01 Thread Guido van Rossum
Everyone on the mypy team has a different opinion so the search is on. :-( On Wed, Jun 1, 2016 at 5:37 PM, Hai Nguyen wrote: > I am +1 for DistinctType (vs others) (no specific reason, just read out > loud). > > Hai > > On Wednesday, June 1, 2016, Guido van Rossum

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

2016-06-01 Thread Guido van Rossum
Unless Jukka objects I am going with "distinct type" when discussing the feature but NewType() in code. -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev

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

2016-06-01 Thread rndblnch
Nick Coghlan gmail.com> writes: > On 31 May 2016 3:12 pm, "Glenn Linderman" wrote: > > On 5/31/2016 12:55 PM, rndblnch wrote: > >> Guido van Rossum gmail.com> writes: > >> > >>> > >>> Also -- the most important thing.  What to call these things? [...] > > Interesting!

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

2016-05-31 Thread Bernardo Sulzbach
On 05/31/2016 08:58 PM, Nick Coghlan wrote: On 31 May 2016 3:12 pm, "Glenn Linderman" wrote: On 5/31/2016 12:55 PM, rndblnch wrote: Guido van Rossum gmail.com> writes: Also -- the most important thing. What to call these things? We're pretty much settled on the

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

2016-05-31 Thread Glenn Linderman
On 5/31/2016 4:58 PM, Nick Coghlan wrote: On 31 May 2016 3:12 pm, "Glenn Linderman" > wrote: > > On 5/31/2016 12:55 PM, rndblnch wrote: >> >> Guido van Rossum gmail.com > writes: >> >>> >>> Also -- the most important

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

2016-05-31 Thread Nick Coghlan
On 31 May 2016 3:12 pm, "Glenn Linderman" wrote: > > On 5/31/2016 12:55 PM, rndblnch wrote: >> >> Guido van Rossum gmail.com> writes: >> >>> >>> Also -- the most important thing. What to call these things? We're >>> pretty much settled on the semantics and how to create

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

2016-05-31 Thread Glenn Linderman
On 5/31/2016 12:55 PM, rndblnch wrote: Guido van Rossum gmail.com> writes: Also -- the most important thing. What to call these things? We're pretty much settled on the semantics and how to create them (A = NewType('A', int)) but what should we call types like A when we're talking about

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

2016-05-31 Thread rndblnch
Guido van Rossum gmail.com> writes: > > Also -- the most important thing. What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about them? "New types" sounds awkward.

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

2016-05-30 Thread Glenn Linderman
On 5/29/2016 9:57 AM, jon wrote: The aspects we want to capture in a name or adjective for these types are: a) The types have identical implementations or definitions. b) They are distinct types. I think “Distinguished Type” or”Cloned Type” best captures these qualities. I think the following

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

2016-05-29 Thread Fred Drake
On Sun, May 29, 2016 at 4:53 PM, Guido van Rossum wrote: > I am currently in favor of Distinct Type [Alias]. I actually like distinguished type better: A = typing.distinguish("A", int) -Fred -- Fred L. Drake, Jr. "A storm broke loose in my mind." --Albert

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

2016-05-29 Thread Guido van Rossum
On Sun, May 29, 2016 at 4:08 PM, Oscar Benjamin wrote: > > On 28 May 2016 00:03, "Guido van Rossum" wrote: >> >> Also -- the most important thing. :-) What to call these things? We're >> pretty much settled on the semantics and how to create them

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

2016-05-29 Thread Guido van Rossum
On Sun, May 29, 2016 at 12:07 PM, Jelle Zijlstra wrote: > > > 2016-05-27 16:01 GMT-07:00 Guido van Rossum : >> >> Also -- the most important thing. :-) What to call these things? We're >> pretty much settled on the semantics and how to create them

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

2016-05-29 Thread Oscar Benjamin
On 28 May 2016 00:03, "Guido van Rossum" wrote: > > Also -- the most important thing. :-) What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about

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

2016-05-29 Thread Jelle Zijlstra
2016-05-27 16:01 GMT-07:00 Guido van Rossum : > Also -- the most important thing. :-) What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about

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

2016-05-29 Thread Terry Reedy
On 5/29/2016 12:57 PM, jon wrote: The aspects we want to capture in a name or adjective for these types are: a) The types have identical implementations or definitions. b) They are distinct types. I think “Distinguished Type” or”Cloned Type” best captures these qualities. 'Cloned Type'

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

2016-05-29 Thread jon
The aspects we want to capture in a name or adjective for these types are: a) The types have identical implementations or definitions. b) They are distinct types. I think “Distinguished Type” or”Cloned Type” best captures these qualities. I think the following also capture the quality, but

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

2016-05-28 Thread Ivan Levkivskyi
Type clone sounds good. But I am still inclined more towards "distinct". -- Ivan 29 Тра 2016 01:04 "Chris Jerdonek" пише: > On Fri, May 27, 2016 at 9:26 PM, Guido van Rossum > wrote: > > We discussed this over dinner at PyCon, some ideas we came up

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

2016-05-28 Thread cs
On 28May2016 08:19, Steve Dower wrote: Did anyone suggest "distinct type alias"? Regardless of what name, I'm fairly sure people will call it whatever the function to create it is called. So if the function is typings.distinguish_type(...), then distinguished will

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

2016-05-28 Thread Chris Jerdonek
On Fri, May 27, 2016 at 9:26 PM, Guido van Rossum wrote: > We discussed this over dinner at PyCon, some ideas we came up with: > > - Dependent types, harking back to a similar concept in Ada > (https://en.wikibooks.org/wiki/Ada_Programming/Type_System#Derived_types) > which in

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

2016-05-28 Thread Bernardo Sulzbach
On 05/28/2016 12:19 PM, Steve Dower wrote: Did anyone suggest "distinct type alias"? I would just like to mention that "distinguished" seems to be more often associated with notability and excellence than "distinct", which is usually more neutral towards the quality of what it describes.

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

2016-05-28 Thread Stephen J. Turnbull
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

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

2016-05-28 Thread Peter Ludemann via Python-Dev
ll stick. >> > >> > Top-posted from my Windows Phone >> > ____________ >> > From: Guido van Rossum >> > Sent: ‎5/‎28/‎2016 7:38 >> > To: Steven D'Aprano >> > Cc: Python-Dev >> > Subject: Re: [Python-Dev] Ad

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

2016-05-28 Thread Ivan Levkivskyi
d. So if the function is > > typings.distinguish_type(...), then distinguished will stick. > > > > Top-posted from my Windows Phone > > > > From: Guido van Rossum > > Sent: ‎5/‎28/‎2016 7:38 > > To: Steven D'Aprano > > Cc: Pyth

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

2016-05-28 Thread Guido van Rossum
n to create it is called. So if the function is > typings.distinguish_type(...), then distinguished will stick. > > Top-posted from my Windows Phone > > From: Guido van Rossum > Sent: ‎5/‎28/‎2016 7:38 > To: Steven D'Aprano > Cc: Python-Dev > Subject

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

2016-05-28 Thread Ivan Levkivskyi
There is another interesting idea from Twitter: call them type wrappers. -- Ivan On 28 May 2016 at 11:01, Ivan Levkivskyi wrote: > > On 28 May 2016 at 06:26, Guido van Rossum wrote: > > > Personally I'm still in favor of Derived type (but I'm more into >

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

2016-05-28 Thread Ivan Levkivskyi
On 28 May 2016 at 06:26, Guido van Rossum wrote: > Personally I'm still in favor of Derived type (but I'm more into > ancient programming languages than most folks here). I could also live > with Distinguished Type. I think both "derived" and "distinguished" are OK, but I am

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

2016-05-28 Thread Steve Dower
al Message- From: "Guido van Rossum" <gu...@python.org> Sent: ‎5/‎28/‎2016 7:38 To: "Steven D'Aprano" <st...@pearwood.info> Cc: "Python-Dev" <python-dev@python.org> Subject: Re: [Python-Dev] Adding NewType() to PEP 484 Just to add to the list of opt

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

2016-05-28 Thread Guido van Rossum
Just to add to the list of options, Twitter also came up with - invention - DomainType - TypedAlias But seriously I think we should just decide between Derived Type and Distinguished Type [Alias]. The latter comes from the idea that when you write e.g. UserId = int then UserId is a type

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

2016-05-28 Thread Steven D'Aprano
On Fri, May 27, 2016 at 09:26:29PM -0700, Guido van Rossum wrote: > We discussed this over dinner at PyCon, some ideas we came up with: > > - Dependent types, harking back to a similar concept in Ada > (https://en.wikibooks.org/wiki/Ada_Programming/Type_System#Derived_types) > which in that

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

2016-05-28 Thread André Malo
* Steven D'Aprano wrote: > On Fri, May 27, 2016 at 04:01:11PM -0700, Guido van Rossum wrote: > > Also -- the most important thing. :-) What to call these things? We're > > pretty much settled on the semantics and how to create them (A = > > NewType('A', int)) but what should we call types like A

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

2016-05-27 Thread Guido van Rossum
On Fri, May 27, 2016 at 6:59 PM, Greg Ewing wrote: > Steven D'Aprano wrote: > >> TypeAlias? Because A is an alias for int? > > > That suggests it's just another name for the same type, > but it's not. It's a distinct type as far as the static > type checker is

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

2016-05-27 Thread Greg Ewing
Steven D'Aprano wrote: TypeAlias? Because A is an alias for int? That suggests it's just another name for the same type, but it's not. It's a distinct type as far as the static type checker is concerned. -- Greg ___ Python-Dev mailing list

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

2016-05-27 Thread Greg Ewing
Guido van Rossum wrote: Also -- the most important thing. :-) What to call these things? We're pretty much settled on the semantics and how to create them (A = NewType('A', int)) but what should we call types like A when we're talking about them? "New types" sounds awkward. Fake types? Virtual

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

2016-05-27 Thread Steven D'Aprano
On Fri, May 27, 2016 at 04:01:11PM -0700, Guido van Rossum wrote: > Also -- the most important thing. :-) What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about them?

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

2016-05-27 Thread Guido van Rossum
Also -- the most important thing. :-) What to call these things? We're pretty much settled on the semantics and how to create them (A = NewType('A', int)) but what should we call types like A when we're talking about them? "New types" sounds awkward. On Fri, May 27, 2016 at 12:54 PM, Guido van

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

2016-05-27 Thread Guido van Rossum
Sorry, this is more meant to be the start of a discussion about the proposed feature. And typing.py has its own upstream repo (like asyncio). --Guido (mobile) On May 27, 2016 12:52 PM, "Brett Cannon" wrote: > Patches to Python's stdlib should go through bugs.python.org so it

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

2016-05-27 Thread Brett Cannon
Patches to Python's stdlib should go through bugs.python.org so it isn't lost in email. On Fri, May 27, 2016, 12:00 Ivan Levkivskyi wrote: > Hi, > > It has been proposed to enhance the typing module with a NewType function > that allows to define simple unique types with

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

2016-05-27 Thread Ivan Levkivskyi
Hi, It has been proposed to enhance the typing module with a NewType function that allows to define simple unique types with almost zero runtime overhead. The PR containing actual implementation and PEP 484 update is here: https://github.com/python/typing/pull/226 Review comments are very