Skip to content

Conversation

uriyyo
Copy link
Contributor

@uriyyo uriyyo commented May 4, 2021

Fix mypy plugin issue with self field.

Currently mypy plugin will fail at this code:

from pydantic import BaseModel


class Model(BaseModel):
    self: str
error: Name 'self' already defined (possibly by an import)  [no-redef]

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@uriyyo
Copy link
Contributor Author

uriyyo commented May 4, 2021

please review

Copy link
Collaborator

@PrettyWood PrettyWood left a comment

Choose a reason for hiding this comment

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

Thanks! 🙏

@PrettyWood PrettyWood merged commit 0d1ed53 into pydantic:master Sep 4, 2021
jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Oct 7, 2021
* Fix mypy issue with self field

* Add docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants