Skip to content

Incorrect assuming class property is a method #12975

@Behoston

Description

@Behoston

Bug Report

To Reproduce

class Example:
    @property
    @classmethod
    def example(cls) -> typing.List[str]:
        return ['str', 'ing', 's']
variable: typing.List[str] = Example.example

Expected Behavior
no mypy errors

Actual Behavior
error:
error: List or tuple expected as variable arguments

Your Environment

  • Mypy version used: 0.941
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.9
  • Operating system and version: Linux Mint IDK

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions