[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-09-30 Thread Matthias Troffaes
Matthias Troffaes added the comment: Chiming in here: Sphinx's testing framework does include a feature that allows easily read/write files into/from text/bytes directly from path-like objects. There is thus a demand out there. If this feature were to make it into stdlib, it would be loved

[issue20218] Add methods to `pathlib.Path`: `write_text`, `read_text`, `write_bytes`, `read_bytes`

2014-09-30 Thread Matthias Troffaes
Matthias Troffaes added the comment: Thanks for the quick response. I agree with Georg on all points, i.e. longer function names and no extra options. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20218

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2011-08-04 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: Patch against current tip attached. I can no longer reproduce the large memory leaks with the current tip (which is of course wonderful!), so I guess the second part of the patch (freeing the freelists during gc.collect) makes

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2010-05-21 Thread Matthias Troffaes
Changes by Matthias Troffaes matthias.troff...@gmail.com: Added file: http://bugs.python.org/file17427/py3k-rev81387-clearfreelist-dict_set_list.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6695

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2010-05-21 Thread Matthias Troffaes
Changes by Matthias Troffaes matthias.troff...@gmail.com: Added file: http://bugs.python.org/file17428/py3k-rev81387-clearfreelist-gc_collect.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6695

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2010-05-21 Thread Matthias Troffaes
Changes by Matthias Troffaes matthias.troff...@gmail.com: Added file: http://bugs.python.org/file17429/py3k-rev81387-clearfreelist-time_gc_collect.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6695

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2010-05-21 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: I uploaded updates of the three relevant patches against the current revision of the py3k branch, as the old patches no longer applied cleanly due to whitespace changes. To summarize: * The first patch, py3k-rev81387

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-17 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: To aid the discussion, I attach another quick patch which reports the time spent on PyXXX_ClearFreeList calls during highest generation garbage collection (including gc.collect()). For simplicity, the timer uses clock() so

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-14 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: Thanks for the feedback! Attaching a new patch which implements tp_free_list slot as suggested - I hope I did it correctly. I've only implemented the new slot for dict so far, but I'm happy to tp_free_list-ify the other freelist

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes
New submission from Matthias Troffaes matthias.troff...@gmail.com: The Python C API provides PyXXX_ClearFreeList functions to allow the float, int, etc... freelists to be freed, potentially releasing memory to the OS earlier. Currently, there is no such API for the dict, set, and list freelists

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: I attach a second patch which also calls the new PyXXX_ClearFreeList functions on garbage collection, during gc.collect(). -- Added file: http://bugs.python.org/file14709/py3k-clearfreelist-gc_collect.patch

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes
Matthias Troffaes matthias.troff...@gmail.com added the comment: I'm also attaching a test script to check the effect of the two patches on gc.collect(). If many objects are allocated, space savings appear to be relevant. Before applying the patch (debug build on linux 64 bit): Memory used