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

Type of parameter "self" is unknown (reportUnknownParameterType) when subclassing typing.Protocol #458

Closed
ghost opened this issue Oct 5, 2020 · 3 comments
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@ghost
Copy link

ghost commented Oct 5, 2020

Environment data

  • Language Server version: 2020.9.8
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.8.5

Expected behaviour

The "self" parameter should have the type of class to which its method belongs (as it is in other cases).

Actual behaviour

from typing import Protocol

class Foo(Protocol):
    def bar(self) -> None:
        ...

reports

(parameter) self: Unknown
"self" is not accessed Pylance
Type of parameter "self" is unknown Pylance (reportUnknownParameterType)
@github-actions github-actions bot added the triage label Oct 5, 2020
@jakebailey
Copy link
Member

@erictraut Seems like a bug for self to be marked as unknown in this context (or any context, really...)

@jakebailey jakebailey added bug Something isn't working needs investigation Could be an issue - needs investigation labels Oct 5, 2020
@github-actions github-actions bot removed the triage label Oct 5, 2020
@erictraut
Copy link
Contributor

Thanks for the bug report. This will be fixed in the next release.

@erictraut erictraut added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Oct 5, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.10.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#2020100-7-october-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

2 participants