This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing class getitems in standard library classes
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, brett.cannon, gvanrossum, levkivskyi, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2019-12-10 17:55 by BTaskaya, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 17558 merged BTaskaya, 2019-12-10 18:06
PR 17560 merged BTaskaya, 2019-12-10 18:12
PR 17561 closed BTaskaya, 2019-12-10 18:24
PR 17563 closed BTaskaya, 2019-12-10 18:28
Messages (8)
msg358209 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-12-10 17:55
After working on issue 38994 and issue 38978, I decided to write a simple AST analyzer to find class getitem syntax usage in typeshed. It discovered a few classes (I am not sure if there are more). As @brett.cannon suggested in PR 17498 I'll prepare individual pull requests.  

typeshed/stdlib/3/subprocess.pyi:868  => Popen
typeshed/stdlib/3/subprocess.pyi:82   => CompletedProcess
typeshed/stdlib/3/tempfile.pyi:98     => SpooledTemporaryFile
typeshed/stdlib/3/os/__init__.pyi:463 => DirEntry
typeshed/stdlib/3/http/cookies.pyi:5  => Morsel
msg359043 - (view) Author: Ivan Levkivskyi (levkivskyi) * (Python committer) Date: 2019-12-30 16:02
New changeset 4dc5a9df59837446ec1dc5b7a0e6ce95ae5b5cec by Ivan Levkivskyi (Batuhan Taşkaya) in branch 'master':
bpo-39019: Implement missing __class_getitem__ for subprocess classes (GH-17558)
https://github.com/python/cpython/commit/4dc5a9df59837446ec1dc5b7a0e6ce95ae5b5cec
msg359044 - (view) Author: Ivan Levkivskyi (levkivskyi) * (Python committer) Date: 2019-12-30 16:08
New changeset 09c482fad11c769be38b2449f1056e264b701bb7 by Ivan Levkivskyi (Batuhan Taşkaya) in branch 'master':
bpo-39019: Implement missing __class_getitem__ for SpooledTemporaryFile (GH-17560)
https://github.com/python/cpython/commit/09c482fad11c769be38b2449f1056e264b701bb7
msg362530 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-02-23 17:56
Once PEP 585 is implemented these should be rolled back and replaced with that, right?
msg362533 - (view) Author: Ivan Levkivskyi (levkivskyi) * (Python committer) Date: 2020-02-23 18:32
> Once PEP 585 is implemented these should be rolled back and replaced with that, right?

I would say that ideally yes.
msg365937 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-04-07 20:36
PEP 585 is landed, closing the issue (and linked PRs)
msg365941 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2020-04-07 20:53
Hold on, os.DirEntry[str] still doesn't work.
msg365942 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2020-04-07 20:55
> Hold on, os.DirEntry[str] still doesn't work.

That is what I asked on the issue 39481. I couldn't find anything about its cover on PEP 585.
History
Date User Action Args
2022-04-11 14:59:24adminsetgithub: 83200
2020-04-07 20:55:44BTaskayasetmessages: + msg365942
2020-04-07 20:53:15gvanrossumsetmessages: + msg365941
2020-04-07 20:37:14BTaskayasetstatus: open -> closed
stage: patch review -> resolved
2020-04-07 20:36:51BTaskayasetmessages: + msg365937
2020-02-23 22:37:39serhiy.storchakasetpull_requests: - pull_request17994
2020-02-23 22:13:32serhiy.storchakasetnosy: + serhiy.storchaka
pull_requests: + pull_request17994
2020-02-23 18:32:09levkivskyisetmessages: + msg362533
2020-02-23 17:56:37gvanrossumsetnosy: + gvanrossum
messages: + msg362530
2019-12-30 16:08:15levkivskyisetmessages: + msg359044
2019-12-30 16:02:20levkivskyisetmessages: + msg359043
2019-12-10 18:28:53BTaskayasetpull_requests: + pull_request17035
2019-12-10 18:24:25BTaskayasetpull_requests: + pull_request17033
2019-12-10 18:12:28BTaskayasetpull_requests: + pull_request17032
2019-12-10 18:06:57BTaskayasetkeywords: + patch
stage: patch review
pull_requests: + pull_request17030
2019-12-10 18:00:10BTaskayasetnosy: + levkivskyi

components: + Library (Lib)
versions: + Python 3.9
2019-12-10 17:55:54BTaskayacreate