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

Nested classes being flagged as wrong as of 0.4.12 #916

Open
eliasmistler opened this issue Apr 9, 2024 · 0 comments
Open

Nested classes being flagged as wrong as of 0.4.12 #916

eliasmistler opened this issue Apr 9, 2024 · 0 comments

Comments

@eliasmistler
Copy link

Describe the bug
Nested class definitions are being marked as of the latest version.
I'm pretty sure it wasn't a problem in 0.4.11, but I can't downgrade now as I've updated my PyCharm and 0.4.11 is not compatible with PyCharm 2024.1.

To Reproduce
You can use the following example code:

from pydantic import BaseModel


class Outer(BaseModel):
    class Inner(BaseModel):
        inner_attr: str

    inner: Inner
    outer_attr: str


outer = Outer(inner=Outer.Inner(inner_attr='foo'), outer_attr='bar')

The call to Outer.Inner will be highlighted as a warning

Expected behavior
This should not be highlighted as an issue

Screenshots
image

Environments

  • IDE: PyCharm Professional 2024.1
  • OS: macOS 14.4
  • Pydantic Version: 1.10.14
  • Plugin version: 0.4.12
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

No branches or pull requests

1 participant