Code Monkey home page Code Monkey logo

Comments (2)

jab avatar jab commented on August 12, 2024

In the meantime, the garbage collector handles these just fine:

~> ipython
Python 2.7.8 (default, Aug 28 2014, 15:56:03)
Type "copyright", "credits" or "license" for more information.

IPython 2.3.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import gc

In [2]: gc.set_debug(gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_OBJECTS)

In [3]: gc.collect()
...
Out[3]: 211

In [4]: from bidict import bidict

In [5]: b = bidict()

In [6]: b = None

In [7]: gc.collect()
gc: collectable <bidict 0x10cfb57d0>
gc: collectable <dict 0x10cfe3398>
gc: collectable <bidict 0x10cfb5710>
gc: collectable <dict 0x10cfd8280>
Out[7]: 4

This just demonstrated that once a bidict's refcount drops to 0, the garbage collector is able to free it (b), the inverse bidict it refers to and that refers to it (b._inv), and their two backing dicts (b._fwd and b._bwd).

Punting for now.

from bidict.

jab avatar jab commented on August 12, 2024

document current behavior: 54bece2

from bidict.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.