Closed GoogleCodeExporter closed 9 years ago
How about using Python's built-in "with" statement to handle file opening and
closing? http://effbot.org/zone/python-with-statement.htm
Original comment by phil.stp...@gmail.com
on 31 Jan 2012 at 11:44
Context managers do appear to be useful, but aren't yet common place in python
code. Even if we support them (by defining __enter__ and __exit__ methods) we
can't guarantee people will use them. Also while this would address the open
file issue (when "with" is used), it will not address the reference cycle
problem, which can lead to memory leaks and just slower running code (as
garbage collection takes time).
We should however add support for the with statement in FileIO as a new feature.
Original comment by schmi...@gmail.com
on 1 Feb 2012 at 12:25
caching the _By_Row object in FileIO.py turns out to be unnecessary. Creating
the _By_Row object involves less overhead than checking for it in a dictionary
and returning it. I confirmed this by profiling with and without caching.
Without caching is just slightly faster. The same is true for _By_Col in
Tables.py
By not caching it, there is no cleanup necessary and we avoid reference cycles.
Fixed in r1282
Original comment by schmi...@gmail.com
on 26 Jul 2012 at 3:24
Original issue reported on code.google.com by
schmi...@gmail.com
on 31 Jan 2012 at 4:28