-
Notifications
You must be signed in to change notification settings - Fork 767
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
Where does pylance get the existence of pandas.DataFrame.__iadd__
?
#1245
Comments
We wrote and bundled stubs for pandas that are mirrored here: https://github.com/microsoft/python-type-stubs To be clear, this is a function that you're saying the stub is missing? |
Finally, I've figured it out. According to the bundled stub, |
There is another problem -- Try running the example: class C:
def __iadd__(self, x):
return 0
c = C()
c += "abc"
print(c) # Prints 0.
c = C()
c.__iadd__ = lambda x: 1
c += "abc"
print(c) # Still prints 0, instead of 1. By using Normally, we are not writing code like in the example, so it needs not to be concerned whether the method implementation is different between the class and the instance. But I think the results returned by |
Related: #1252 |
I'm closing this issue, because the question in the title has already had an answer. Besides, I don't think the root of problems lies in the bundled stub. The stub should work correctly once #1252 were fixed. |
Try with the bundled Pandas stubs:
Pylance seems to think that
DataFrame
has a member of__iadd__
with no explicit signature, but I searched through the stubs and failed to find a valid definition of__iadd__
inDataFrame
or any of its ancestors. There is__iadd__
in the library code though.Is it from the library code instead of the stubs?
The text was updated successfully, but these errors were encountered: