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

Completion adds superfluous "=" to field name #580

Closed
chbndrhnns opened this issue Nov 9, 2022 · 1 comment · Fixed by #596
Closed

Completion adds superfluous "=" to field name #580

chbndrhnns opened this issue Nov 9, 2022 · 1 comment · Fixed by #596

Comments

@chbndrhnns
Copy link

Describe the bug
The plugin produces a SyntaxError when completing field names.

import pydantic

class M(pydantic.BaseModel):
    old_password: str ="abc"
    new_password: str = "abc"

def test_():
    assert M(oldnew_password="def")

To Reproduce

  1. Put cursor after old in the last line
  2. Ctrl+space
  3. Tab complete
  4. Gives me assert M(old_password=="def")

Expected behavior

Not comparison, but assignment:

assert M(old_password="def")

Screenshots
Screenshot 2022-11-09 at 19 38 56

Environments (please complete the following information):

  • IDE: PyCharm Pro 2022.3 EAP 4
  • OS: macos 12.6
  • Pydantic Version: 1.10
  • Plugin version: 0.3.15

Additional context
Add any other context about the problem here.

@koxudaxi
Copy link
Owner

@chbndrhnns
Thank you for creating the issue.
The fixed version has been released.

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 a pull request may close this issue.

2 participants