Skip to content

Mypy emits error on decorated property #5561

Closed
@rpgoldman

Description

@rpgoldman

Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues

Please provide more information to help us understand the issue:

  • Are you reporting a bug, or opening a feature request?
    Bug

  • Please insert below the code you are checking with mypy,
    pymc3 -- see mypy error trying to check pymc3 #5560

  • What is the actual behavior/output?
    I get this error message:

pymc3/model.py:672: error: Decorated property not supported

Not sure what this means or what to do about it.

  • What is the behavior/output you expect?
    Either handling the decorated property or error message with suggestion for workaround.

  • What are the versions of mypy and Python you are using?
    Do you see the same issue after installing mypy from Git master?
    This is with mypy from Git master: Testing with mypy 0.630+dev-581e514162797b531a01b86b5266b081e955d6df, commit 8c90771a20e4dff68e416d832c66b0df5dc2f958 from master.

  • What are the mypy flags you are using? (For example --strict-optional)

mypy --show-traceback --ignore-missing-imports pymc3/
  • If mypy crashed with a traceback, please paste
    the full traceback below.
    No crash.

Here is the code snippet (from model.py) that yields an error:

    @property
    @memoize(bound=True)
    def bijection(self):
        vars = inputvars(self.cont_vars)

        bij = DictToArrayBijection(ArrayOrdering(vars),
                                   self.test_point)

        return bij

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