Skip to content

Incorrect assuming class property is a method #12975

Closed as not planned
Closed as not planned

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

Activity

  1. AlexWaygood commented on Jun 12, 2022

    @AlexWaygood
    Member

    classmethod properties are not yet supported by mypy (see #11619), and are deprecated at runtime on 3.11+ (python/cpython#92379)

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

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions