Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound type variable false positive with six.with_metaclass #14475

Closed
JukkaL opened this issue Jan 20, 2023 · 1 comment · Fixed by #14478
Closed

Unbound type variable false positive with six.with_metaclass #14475

JukkaL opened this issue Jan 20, 2023 · 1 comment · Fixed by #14478
Labels

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jan 20, 2023

This code generates a false positive:

import six
import abc
from typing import TypeVar, Generic

T = TypeVar("T")

class C(six.with_metaclass(abc.ABCMeta, Generic[T])):
    pass

class D(six.with_metaclass(abc.ABCMeta, C[T])):  # Type variable "t.T" is unbound
    pass

This is a regression from 0.991 introduced here:

@ilevkivskyi Do you have time to look at this? This is a blocker for the 1.0 release.

@ilevkivskyi
Copy link
Member

ilevkivskyi commented Jan 20, 2023

Here is the fix #14478.

JukkaL pushed a commit that referenced this issue Jan 20, 2023
Fixes #14475

The fix is straightforward. We need to use the "guarded accept" at this
stage, similar to e.g. `clean_up_bases_and_infer_type_variables()`.
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 a pull request may close this issue.

2 participants