Skip to content

gh-151955: Allow more ParamSpec and TypeVarTuple bounds#151956

Open
JelleZijlstra wants to merge 1 commit into
python:mainfrom
JelleZijlstra:tvt-bound
Open

gh-151955: Allow more ParamSpec and TypeVarTuple bounds#151956
JelleZijlstra wants to merge 1 commit into
python:mainfrom
JelleZijlstra:tvt-bound

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Jun 23, 2026

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread Objects/typevarobject.c
}
PyObject *module = caller();
if (module == NULL) {
Py_XDECREF(bound);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need it?

Comment thread Objects/typevarobject.c
}
PyObject *module = caller();
if (module == NULL) {
Py_XDECREF(bound);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Comment thread Lib/test/test_typing.py
def test_paramspec_bound(self):
P = ParamSpec('P', bound=[int, str])
self.assertEqual(P.__bound__, [int, str])
P2 = ParamSpec('P2', bound=(int, str))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also test object() as an arbitrary value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants