-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
core: Add ruff rules for comprehensions (C4) #26829
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@@ -108,7 +108,7 @@ def get_format_instructions(self) -> str: | |||
return "Return a JSON object." | |||
else: | |||
# Copy schema to avoid altering original Pydantic schema. | |||
schema = {k: v for k, v in self._get_schema(self.pydantic_object).items()} | |||
schema = dict(self._get_schema(self.pydantic_object).items()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm why is this not .copy()
(no need to change in this PR -- since the PR should involve no functional changes)
cc @efriis if you want to take another look prior to merging. I think this looks good, code is cleaner and likely at some point will result in a tiny code speed up due to short-circuiting where it wasn't before or due to elimination of redundant operations |
0874e19
to
5231692
Compare
No description provided.