Skip to content

core: deprecate problematic dict() method #31685

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbornet
Copy link
Collaborator

@cbornet cbornet commented Jun 20, 2025

dict() is a problematic method name as it clashes with the builtin dict used as a type annotation.
This PR replaces it with an asdict method (inspired by dataclasses).
It also fixes a few places where dict must be replaced by typing.Dict until the dict() method is removed.

Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jun 20, 2025 4:10pm

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 20, 2025
@cbornet cbornet requested a review from eyurtsev June 20, 2025 16:09
@dosubot dosubot bot added the 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs label Jun 20, 2025
Copy link

codspeed-hq bot commented Jun 20, 2025

CodSpeed WallTime Performance Report

Merging #31685 will not alter performance

Comparing cbornet:typing-dict (a47e5a0) with master (7ff4050)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Jun 20, 2025

CodSpeed Instrumentation Performance Report

Merging #31685 will not alter performance

Comparing cbornet:typing-dict (a47e5a0) with master (7ff4050)

Summary

✅ 13 untouched benchmarks

@eyurtsev
Copy link
Collaborator

eyurtsev commented Jun 20, 2025

We could merge as part of the 0.4 release. Unclear yet whether this change should be made -- better not to clash with a built in for new code, but for existing code this would be weighed from a cost benefit analysis to end users

@eyurtsev eyurtsev self-assigned this Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.4 release 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants