PyTables/PyTables — pull request #311 by avalentino (2013-12-31 20:33:44+00:00)
Title: Compatibility with Python 3.4

This PR implements a possible solution to the incompatibility (see #306) of the node cache management currently implemented in Pytables 3.0 with the new object finalization strategy (see [1], [2]) introduced in Python 3.4 (tested on Python 3.4b1).

The node caching mechanism has been completely redesigned to be simpler and less dependent from specific behaviors of the ``__del__`` method.

A new NodeManager class has been introduced that takes in charge all stuffs related to node caching and node finalization.
It includes a LRU cache for a fast node access and a `registry` that holds a (weak) reference to all open nodes (including the ones in the cache) to ensure a correct finalization when the file handler is closed.

The new implementation seems to work with all supported python versions (including Python 3.4 tip).
but no performance test has been performed (feedback is welcome).

P.S. probably the documentation regarding `NODE_CACHE_SLOTS` should be updated to reflect the new implementation.

[1] http://docs.python.org/3.4/whatsnew/3.4.html#pep-442-safe-object-finalization
[2] http://www.python.org/dev/peps/pep-0442