Skip to content

stubtest: metaclass is not taken into an account #13327

Closed
@sobolevn

Description

@sobolevn

Here's a simple example of this bug:

# runtime implementation
class A(type):
    def method(self) -> None:
        print('a')

class B(metaclass=A): ...

# This works:
# B.method()

And:

# type stub
class A(type):
    def method(self) -> None: ...

class B: ...  # notice that `metaclass=A` is missing, but `stubtest` does not produce any errors

Notice that this bug prevents using things like B.method() in your code.
I will send a fix asap.

Refs #13316

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions