Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy emits error on decorated property #5561

Closed
rpgoldman opened this issue Sep 2, 2018 · 2 comments
Closed

Mypy emits error on decorated property #5561

rpgoldman opened this issue Sep 2, 2018 · 2 comments

Comments

@rpgoldman
Copy link

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
@ilevkivskyi
Copy link
Member

Duplicate of #1362

(Also I am not sure what is not clear in this error. See the original issue for how to work around this.)

@rpgoldman
Copy link
Author

The original issue provides the work-around, but I didn't find that work-around obvious from the error message. Any reason why the error message shouldn't contain: "comment the @Property line for mypy to ignore" or something like that? Or somehow point to #1362, which has the magic answer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants