Skip to content

Problem inheriting attribute from a generic and non-generic base class #2875

Description

@dmzkrsk
from typing import Generic, TypeVar, NamedTuple


T = TypeVar('T')


class Node(Generic[T]):
    v: T


class IntegerNode(Node[int], NamedTuple('IntegerNode', [('v', int)])):
    pass

Gives me an error:

11: error: Definition of "v" in base class "Node" is incompatible with definition in base class "IntegerNode@11"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions