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

Unexpected warnings on final class derived from ABC #1732

Closed
Azureblade3808 opened this issue Aug 27, 2021 · 4 comments
Closed

Unexpected warnings on final class derived from ABC #1732

Azureblade3808 opened this issue Aug 27, 2021 · 4 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

@Azureblade3808
Copy link

Azureblade3808 commented Aug 27, 2021

Environment data

  • Language Server version: 2021.8.4-pre.1
  • OS and version: Windows 7
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.11 (Anaconda)

Sample code

from abc import ABC
from typing import final

class Base(ABC):
    pass

@final
class Derived(Base):
    pass

_ = Derived()

Expected behavior

No error.

Actual behavior

image

@erictraut
Copy link
Contributor

Thanks for the bug report. It's a trivial fix. I wasn't handling the case where there were no abstract methods defined in the abstract base class. Kind of a weird use case, but I guess it's legit. 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 Aug 27, 2021
@Azureblade3808
Copy link
Author

With some abstract methods in the base class, all of which get implemented in the derived class, the warning still exists. So the issue may not be that rare like the sample shows.

@erictraut
Copy link
Contributor

Yeah, that's a good point. My fix will address that case too.

@jakebailey
Copy link
Member

This issue has been fixed in version 2021.7.0, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202190-1-september-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