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: ParamSpec args and kwargs are not equal to themselves.
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: GBeauregard, JelleZijlstra, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2022-02-07 19:16 by GBeauregard, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31203 merged GBeauregard, 2022-02-07 19:19
PR 31210 merged GBeauregard, 2022-02-08 07:51
Messages (3)
msg412781 - (view) Author: Gregory Beauregard (GBeauregard) * Date: 2022-02-07 19:16
from typing import ParamSpec
P = ParamSpec("P")
print(P.args == P.args)  # False
print(P.kwargs == P.kwargs)  # False

ParamSpec args and kwargs are not equal to themselves; this can cause problems for unit tests and type introspection w/ e.g. `get_type_hints`.

I will fix this by adding an __eq__ method like other places in typing.py
msg412816 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-08 07:47
New changeset c8b62bbe46e20d4b6dd556f2fa85960d1269aa45 by Gregory Beauregard in branch 'main':
bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
https://github.com/python/cpython/commit/c8b62bbe46e20d4b6dd556f2fa85960d1269aa45
msg412820 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-02-08 08:41
New changeset cbdcae5ab90710e8d82c213f3798af1154670ff9 by Gregory Beauregard in branch '3.10':
[3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203) (GH-31210)
https://github.com/python/cpython/commit/cbdcae5ab90710e8d82c213f3798af1154670ff9
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90834
2022-02-08 08:41:51serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2022-02-08 08:41:35serhiy.storchakasetmessages: + msg412820
2022-02-08 07:51:36GBeauregardsetpull_requests: + pull_request29380
2022-02-08 07:47:05serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg412816
2022-02-07 19:19:11GBeauregardsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29373
2022-02-07 19:16:53GBeauregardcreate