Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TypeVarTuple.__typing_prepare_subst__ does not work as intented #96385

Closed
Assignees
sobolevn
Labels
@sobolevn

Description

@sobolevn

Right now there's an uncovered branch inTypeVarTuple.__typing_prepare_subst__:

Снимок экрана 2022-08-29 в 15 16 14

And it looks like there's a bug in it,these two lines:

forparaminenumerate(params[typevartuple_index+1:]):ifisinstance(param,TypeVarTuple):

Thisif's body will never be executed, becauseenumerate always returnstuple[int, T], it is neverTypeVarTuple.

So, I think that we need to removeenumerate() call here and add a test like:

>>>fromtypingimportGeneric,TypeVarTuple>>>V=TypeVarTuple('V')>>>T=TypeVarTuple('T')>>>classMy(Generic[*T]):pass...>>>My[*T,*V][*V]TypeError:MorethanoneTypeVarTupleparameterin__main__.My[*T,*V]

I will send a PR 😉

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp