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

limit the length of generics._limit_assigned_parameters #4083

Merged
merged 10 commits into from May 18, 2022

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented May 16, 2022

Change Summary

As per discussion in #3829 this should avoid memory "leaks" when generating lots of generics.

Related issue number

#3829 - I won't mark this as fixed until confirmed by users.

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

@samuelcolvin samuelcolvin changed the title limit the length of generics._limit_assigned_parameters limit the length of generics._limit_assigned_parameters May 16, 2022
@samuelcolvin samuelcolvin mentioned this pull request May 17, 2022
11 tasks
@samuelcolvin samuelcolvin marked this pull request as ready for review May 17, 2022 17:02
pydantic/generics.py Outdated Show resolved Hide resolved
pydantic/generics.py Outdated Show resolved Hide resolved
@samuelcolvin samuelcolvin merged commit 8846ec4 into master May 18, 2022
@samuelcolvin samuelcolvin deleted the limit_assigned_parameters branch May 18, 2022 14:22
samuelcolvin added a commit that referenced this pull request May 19, 2022
samuelcolvin added a commit that referenced this pull request May 19, 2022
samuelcolvin added a commit that referenced this pull request May 19, 2022
ntaylorwss pushed a commit to nicejobinc/pydantic that referenced this pull request Jun 24, 2022
)

* limit the length of generics._limit_assigned_parameters

* switch to using _limit_cache_size for both

* add change description

* correct `_limit_cache_size` cache

* implemented LimitedDict

* try using UserDict

* try upgrading cython

* stop LimitedDict from inheriting from dict

* separate LimitedDict for typing checking :-(

* fix for __class_getitem__
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