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

Renamed schema variable name to schema_ as there is a schema function defined #2724

Merged

Conversation

ShahriyarR
Copy link
Contributor

@ShahriyarR ShahriyarR commented May 1, 2021

Change Summary

Spotted an anti-pattern which can lead to shadowing in the outer scope, as there is a function named schema.
Renamed all schema variables to schema_

Related issue number

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)

@samuelcolvin
Copy link
Member

This looks good. Please could you add a change description.

Also, in future please use the PR template.

@ShahriyarR
Copy link
Contributor Author

ShahriyarR commented May 1, 2021

Done

@PrettyWood PrettyWood merged commit 7108652 into pydantic:master Sep 4, 2021
@PrettyWood
Copy link
Member

Thanks! 🙏

jpribyl pushed a commit to liquet-ai/pydantic that referenced this pull request Oct 7, 2021
… defined (pydantic#2724)

* Renamed schema variable name to schema_ as there is a schema function already defined

* Same approach in enum_process_schema()

* added changes file

* Update changes/2724-shahriyarr.md

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* last shadow rename

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
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.

None yet

3 participants