Content-Length: 288914 | pFad | https://github.com/python/cpython/issues/106485

ad Reduce the number of materialized instance `__dict__`s · Issue #106485 · python/cpython · GitHub
Skip to content

Reduce the number of materialized instance __dict__s #106485

Description

@markshannon

Accessing the __dict__ attribute of an object causes the dictionary to be materialized.
This has a negative impact on performance.
We should provide means to access the __dict__ without forcing materialization, which can be used in copy, pickle and any third party code that chooses to.

I propose two new methods on object:

  • __dict_copy__(self), which will be equivalent to self.__dict__.copy(), but without materializing the dictionary of objects with virtual dictionaries.
  • __dict_update__(self, arg), which will be equivalent to self.__dict__.update(arg), but without materializing the dictionary of objects with virtual dictionaries.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/106485

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy