[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-03-13 Thread Guido van Rossum
This now happened. Maybe you can just submit it to the SC for review? Or
did that already happen? (I no longer have any insight into the SC's queue.)

On Tue, Feb 25, 2020 at 2:40 PM Łukasz Langa  wrote:

>
> On 25 Feb 2020, at 16:22, Guido van Rossum  wrote:
>
> Łukasz, do you agree?
>
>
> As long as we include a form of Nick's explanation in the docs for the
> type, I'm fine with that.
>
> - Ł
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ZPVJFR7FUA5RBDOH7EINSJ3NSNWCWALQ/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-25 Thread Łukasz Langa

> On 25 Feb 2020, at 16:22, Guido van Rossum  wrote:
> 
> Łukasz, do you agree?

As long as we include a form of Nick's explanation in the docs for the type, 
I'm fine with that.

- Ł___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/7EIE47KHZ2KDNTSUZRJNDU5C6SGQUJM6/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-25 Thread Guido van Rossum
OK, it's certainly easier *not* to change it, so I'm happy with this
argument for the current name.

Łukasz, do you agree?

Then I think we can submit this to the SC for acceptance.

On Tue, Feb 25, 2020 at 6:27 AM Nick Coghlan  wrote:

> On Tue, 25 Feb 2020 at 15:19, Ethan Smith  wrote:
> >
> > The discussion on the name change came from Łukasz
> https://github.com/python/cpython/pull/18239#discussion_r380996908
> >
> > I suggested "GenericType" to be in line with other things in types.py.
>
> Quoting Łukasz question: "I know it's late for this bikeshedding but I
> was always a bit puzzled by the name "GenericAlias". What is it
> aliasing?"
>
> The "GenericAlias" name seemed appropriate to me as these aren't real
> types - they're aliases for the corresponding container type with some
> extra metadata attached. So "list[str]" is *mostly* just a different
> way of writing "list" at runtime - it's primarily typecheckers that
> will treat it differently (while the runtime typechecking machinery
> will reject it as too specific to be checked non-destructively).
>
> "GenericAliasForAConcreteContainerType" would be excessively wordy
> though, hence "GenericAlias".
>
> By contrast, I'd expect something called "GenericType" to actually be
> able to do full runtime typechecking and enforcement (e.g. having
> instances throw TypeError if you tried to insert a value of the wrong
> type).
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/ELZLDTZVBUM5DFJV3D46I2QKXGFNYRGC/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-25 Thread Nick Coghlan
On Tue, 25 Feb 2020 at 15:19, Ethan Smith  wrote:
>
> The discussion on the name change came from Łukasz  
> https://github.com/python/cpython/pull/18239#discussion_r380996908
>
> I suggested "GenericType" to be in line with other things in types.py.

Quoting Łukasz question: "I know it's late for this bikeshedding but I
was always a bit puzzled by the name "GenericAlias". What is it
aliasing?"

The "GenericAlias" name seemed appropriate to me as these aren't real
types - they're aliases for the corresponding container type with some
extra metadata attached. So "list[str]" is *mostly* just a different
way of writing "list" at runtime - it's primarily typecheckers that
will treat it differently (while the runtime typechecking machinery
will reject it as too specific to be checked non-destructively).

"GenericAliasForAConcreteContainerType" would be excessively wordy
though, hence "GenericAlias".

By contrast, I'd expect something called "GenericType" to actually be
able to do full runtime typechecking and enforcement (e.g. having
instances throw TypeError if you tried to insert a value of the wrong
type).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/RB3DOICJURSPGMNYLJDGTPZO3MZ3EVKN/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-24 Thread Ethan Smith
The discussion on the name change came from Łukasz
https://github.com/python/cpython/pull/18239#discussion_r380996908

I suggested "GenericType" to be in line with other things in types.py.

On Mon, Feb 24, 2020 at 8:39 PM Guido van Rossum  wrote:

> I can't find it right now, but IIRC somebody commented that "GenericAlias"
> is a somewhat odd name. I didn't spend much time thinking about the name, I
> just took it from `typing._GenericAlias` (which has a similar role).
>
> It would be hard to change the name later. ATM it's one global substitute
> on my branch. Should we change it? To what?
>
> --
> --Guido van Rossum (python.org/~guido)
> *Pronouns: he/him **(why is my pronoun here?)*
> 
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/B7P3DITJDZAUHWESPBI34IYMALULGTF2/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-24 Thread Guido van Rossum
I can't find it right now, but IIRC somebody commented that "GenericAlias"
is a somewhat odd name. I didn't spend much time thinking about the name, I
just took it from `typing._GenericAlias` (which has a similar role).

It would be hard to change the name later. ATM it's one global substitute
on my branch. Should we change it? To what?

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/PWAGCL3TQG3DPZ4D7Z7QB4WLHWAY3F4M/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-23 Thread Batuhan Taskaya
This issue might be useful about it: https://bugs.python.org/issue39019

On Sun, Feb 23, 2020 at 2:12 PM Ethan Smith  wrote:
>
> While working on the implementation with Guido I made a list of things that 
> inherit from typing.Generic in typeshed that haven't been listed/implemented 
> yet.
>
> https://github.com/gvanrossum/cpython/pull/1#issuecomment-582781121
>
>
>
> On Sat, Feb 22, 2020, 3:50 PM Nick Coghlan  wrote:
>>
>> This looks like a nice usability improvement to me.
>>
>> My only suggestion would be that types.MappingProxyType be included on the 
>> list of types to be updated.
>>
>> Cheers,
>> Nick.
>> ___
>> Python-Dev mailing list -- python-dev@python.org
>> To unsubscribe send an email to python-dev-le...@python.org
>> https://mail.python.org/mailman3/lists/python-dev.python.org/
>> Message archived at 
>> https://mail.python.org/archives/list/python-dev@python.org/message/EYU3VDK7T4OVT7MXM5OWOPFA4YKWXVDE/
>> Code of Conduct: http://python.org/psf/codeofconduct/
>
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/python-dev@python.org/message/Z47AGWUR5ZVQQ7GEEFQYPE5HBCUMEL44/
> Code of Conduct: http://python.org/psf/codeofconduct/
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/SMSLIJOYCEFN6TEWHFX7ELO5FWKJEGYK/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-23 Thread Ethan Smith
While working on the implementation with Guido I made a list of things that
inherit from typing.Generic in typeshed that haven't been
listed/implemented yet.

https://github.com/gvanrossum/cpython/pull/1#issuecomment-582781121



On Sat, Feb 22, 2020, 3:50 PM Nick Coghlan  wrote:

> This looks like a nice usability improvement to me.
>
> My only suggestion would be that types.MappingProxyType be included on the
> list of types to be updated.
>
> Cheers,
> Nick.
> ___
> Python-Dev mailing list -- python-dev@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-dev@python.org/message/EYU3VDK7T4OVT7MXM5OWOPFA4YKWXVDE/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/Z47AGWUR5ZVQQ7GEEFQYPE5HBCUMEL44/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: PEP 585: Type Hinting Generics In Standard Collections

2020-02-22 Thread Nick Coghlan
This looks like a nice usability improvement to me.

My only suggestion would be that types.MappingProxyType be included on the
list of types to be updated.

Cheers,
Nick.
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EYU3VDK7T4OVT7MXM5OWOPFA4YKWXVDE/
Code of Conduct: http://python.org/psf/codeofconduct/