Skip to content

Metaclass with Any type should be allowed #2911

Closed

Description

@JukkaL

This should work:

from typing import Any
M = None # type: Any
class C(metaclass=M): pass

Currently M is considered an invalid metaclass.

Also, it should be possible to use a class that is imported from a missing module as a metaclass when using --ignore-missing-imports.

The simplest fix is to just ignore such metaclasses, though a better approach may be to treat them in a similar way as an Any base class (but only for class attributes).

Activity

  1. added a commit that references this issue on Feb 27, 2017
    fd40a17
  2. added a commit that references this issue on Feb 27, 2017
    d2eaa08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions