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

Suggestion of __init_subclass__ should not require classmethod decorator #972

Closed
cdce8p opened this issue Feb 20, 2021 · 2 comments
Closed
Labels
bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@cdce8p
Copy link

cdce8p commented Feb 20, 2021

Environment data

  • Language Server version: 2021.2.3
  • OS and version: darwin x64
  • Python version: 3.9.2
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: strict

Expected behaviour

Suggestion results when writing methods should include __init_subclass__. The @classmethod decorator is implicitly applied and thus not required. See example int PEP 487 and the explanation.

Actual behaviour

__init_subclass__ is only suggested if the @classmethod decorator is used.

Code Snippet / Additional information

class Parent:
    def __init  # show suggestions here

Screen Shot 2021-02-20 at 23 45 42

Screen Shot 2021-02-20 at 23 45 23

@erictraut
Copy link
Contributor

Thanks for reporting the problem. This symbol is unfortunately inconsistent with all other class methods in that it doesn't require a @classmethod decorator. I've added special-case handling in the completion handler to accommodate this exception. This will be fixed in the next release.

@erictraut erictraut added bug Something isn't working fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed triage labels Feb 21, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.2.4, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202124-24-february-2021

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

3 participants