8000 "Invalid base class" when base class is returned from a function. · Issue #4284 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content
"Invalid base class" when base class is returned from a function. #4284
Closed
@erikwright

Description

@erikwright
OTT-ErikWright:crucible erikwright$ cat -n ~/mypy_test.py 
     1  import typing
     2
     3  def c() -> type:
     4      class C:
     5          pass
     6      return C
     7
     8  class D(c()):
     9      pass
OTT-ErikWright:crucible erikwright$ mypy ~/mypy_test.py 
/Users/erikwright/mypy_test.py:8: error: Invalid base class

I also tried returning typing.Any, which seemed like it might work based on #2477 (comment) .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0