Skip to content

Do we want to have weakref support? #646

@pfalcon

Description

@pfalcon

Here's another thing to consider re: completeness of language implementation: do we want to support weak referenced (weakref module)?

On one hand, it's niche feature used rarely enough. On the other hand, it's something which would pretty much help low-memory usage: ability to cache some object in memory, but safely and transparently free it if there's memory pressure.

But efficient implementation of weakrefs is expensive - each object need to grow to contain pointer to its associated weakref. Taking into account that weakrefs are rare, less runtime-efficient, but much more memory-efficient impl of having a separate mapping from obj to its weakref can be used.

Thoughts/comments are welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    py-coreRelates to py/ directory in sourcerfcRequest for Comment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy