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

SONARPY-2362 Document no issue on S6542 when inheriting from annotated class member #2174

Merged
merged 2 commits into from
Nov 26, 2024

Conversation

guillaume-dequenne-sonarsource
Copy link
Contributor

@guillaume-dequenne-sonarsource guillaume-dequenne-sonarsource commented Nov 22, 2024

@guillaume-dequenne-sonarsource guillaume-dequenne-sonarsource marked this pull request as ready for review November 22, 2024 08:39
@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Document no issue on S6542 when inheriting from annotated class member SONARPY-2362 Document no issue on S6542 when inheriting from annotated class member Nov 22, 2024
@@ -14,3 +14,7 @@ def imported_inherited_foo(self) -> Any: # Noncompliant
class ImportedWithMetaClassInherited(ImportedParentWithMetaClass):
def imported_inherited_foo(self) -> Any: # Noncompliant
...

class MyChild(MyClassWithAnnotatedMember):

Choose a reason for hiding this comment

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

Since now we have the more significant difference between locally defined and imported types for v1 type inference, it would be nice to show it in tests as well:

from typing import Callable
class LocalClassWithAnnotatedMember:
  my_member: Callable[[Any],Any] # No issue on nested values of "Callable"

class LocalClassChild(LocalClassWithAnnotatedMember):
  def my_member(self, param: Any) -> Any: # OK, defined in parent
    ...

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM, just one case, which I feel we need to document as well

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link
Contributor

Choose a reason for hiding this comment

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

LGTM!

@maksim-grebeniuk-sonarsource maksim-grebeniuk-sonarsource merged commit 7119dc6 into master Nov 26, 2024
11 checks passed
@maksim-grebeniuk-sonarsource maksim-grebeniuk-sonarsource deleted the document-S6542-behavior branch November 26, 2024 08:41
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