KEMBAR78
Add a `with_config` decorator to comply with typing spec by Viicos · Pull Request #8611 · pydantic/pydantic · GitHub
Skip to content

Conversation

@Viicos
Copy link
Member

@Viicos Viicos commented Jan 23, 2024

May fix #8514, as suggested in a comment.

If accepted, better documentation will follow

Selected Reviewer: @dmontagu

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2024

CodSpeed Performance Report

Merging #8611 will not alter performance

Comparing Viicos:with-config-decorator (7daacab) with main (2792775)

Summary

✅ 10 untouched benchmarks

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

Hey @Viicos,

@dmontagu and I really like this approach. A few notes:

It'd be great if this could also be used with dataclasses. I think as it stands, it can, but you just haven't documented it yet. A few requests for changes (I know you wanted to get this approved before working on additional docs):

  1. Docs update with a vanilla example for both dataclass and TypedDict. Docs in both the "Concepts" section and "API Documentation" section (via docstrings) would be fantastic.
  2. mypy tests with this new decorator, as a proof of concept for how this fixes the original issue.

Thanks a bunch for your work on this - it'll be a great feature to have :).

@pydantic-hooky pydantic-hooky bot added the awaiting author revision awaiting changes from the PR author label Jan 23, 2024
@Viicos
Copy link
Member Author

Viicos commented Jan 24, 2024

Please review

@pydantic-hooky pydantic-hooky bot added ready for review and removed awaiting author revision awaiting changes from the PR author labels Jan 24, 2024
@pydantic-hooky pydantic-hooky bot assigned dmontagu and unassigned Viicos Jan 24, 2024
@Viicos Viicos force-pushed the with-config-decorator branch from edaa36b to d28b239 Compare January 24, 2024 09:30
@Viicos Viicos force-pushed the with-config-decorator branch from d28b239 to 645f7f8 Compare January 24, 2024 09:45
Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

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

@Viicos,

Changes look great. I've requested two small docs updates. Additionally, looks like the mypy test isn't working properly. Could you please update that when you have a chance?

Other than that, looks good to go! Thanks!

@pydantic-hooky pydantic-hooky bot added awaiting author revision awaiting changes from the PR author and removed ready for review labels Jan 24, 2024
@pydantic-hooky pydantic-hooky bot assigned Viicos and unassigned dmontagu Jan 24, 2024
@sydney-runkle
Copy link
Contributor

@Viicos,

I've moved the attached issue into the 2.7.0 milestone :).

@Viicos Viicos force-pushed the with-config-decorator branch from 867bbbb to 1087ab1 Compare January 26, 2024 12:05
@Viicos Viicos force-pushed the with-config-decorator branch from 1087ab1 to 7daacab Compare January 26, 2024 12:47
@sydney-runkle
Copy link
Contributor

@Viicos,

Amazing work 🚀. Merging this now to be included in 2.7.0!

@sydney-runkle sydney-runkle merged commit 3810c7b into pydantic:main Jan 26, 2024
@Viicos Viicos deleted the with-config-decorator branch January 26, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting author revision awaiting changes from the PR author relnotes-feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

__pydantic_config__ fails with mypy

3 participants