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

converting staticmethod calls to the proper decorator usage. #1979

Merged
merged 2 commits into from
May 17, 2021

Conversation

bschnurr
Copy link
Contributor

@bschnurr bschnurr commented May 5, 2021

this was preventing the correct call signature to be displayed in pylance/pyright

What was wrong?

Related to Issue #
image
microsoft/pylance-release#1210

How was it fixed?

image

looking at the description in builtins.pyi

class staticmethod(object):  # Special, only valid as a decorator.

changed the usage from assigning a function to a class member variable to the proper form of defining a new functions and using @staticmethod as a decorator.

One downside is missing docstrings.

Todo:

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@kclowes
Copy link
Collaborator

kclowes commented May 14, 2021

I'm fine with this change. Let me know if you want me to take over fixing the types @bschnurr!

@bschnurr
Copy link
Contributor Author

sure. that would be great. I was working on windows and didn't have everything quite working.

@kclowes kclowes force-pushed the fix-staticmethod-signatures branch from 1aa0f81 to 2bdeeae Compare May 14, 2021 22:09
this was preventing the correct call signature to be displayed in pylance/pyright
@kclowes kclowes force-pushed the fix-staticmethod-signatures branch from 2bdeeae to a0dce31 Compare May 14, 2021 22:13
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bschnurr!

@bschnurr
Copy link
Contributor Author

the @wraps delegate might also be helpful in bringing over the docstrings for the functions

@kclowes
Copy link
Collaborator

kclowes commented May 17, 2021

Good call! Added!

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

Successfully merging this pull request may close these issues.

2 participants