[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: A quick question: Prior to this patch test_memoryview.py exercised both mbuf_clear() and memory_clear(). Now gcov shows no coverage. Is this expected? Is it still possible to construct tests that exercise the code? --

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Is it possible that the use of test.support.gc_collect() in test_memoryview made the difference? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: Sorry folks, I messed up the revisions when testing. This commit has nothing to do with the decreased coverage. Now I properly bisected and in r75481 mbuf_clear() and memory_clear() are still covered, but in r75484 they are not. r75484

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah stefan-use...@bytereef.org added the comment: r75484 should be b595e1ad5722. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930 ___

[issue14930] Make memoryview weakrefable

2012-05-29 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930 ___

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: New patch. -- Added file: http://bugs.python.org/file25742/memoryview-weakref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: In the test, you should call gc.collect() so that it works on non-reference counted implementations. Also, I would call PyObject_ClearWeakRefs() after memory_release() and Py_CLEAR(self-mbuf), not before (in case a weakref callback relies on

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: In the test, you should call gc.collect() so that it works on non- reference counted implementations. I did think about using gc.collect(), but I was not sure whether it was guaranteed to collect everything possible if you only call it

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: I did think about using gc.collect(), but I was not sure whether it was guaranteed to collect everything possible if you only call it only once. (I know nothing about garbage collectors.) You could use support.gc_collect() for

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Doing it after Py_CLEAR(self-mbuf) seems to contradict http://docs.python.org/dev/extending/newtypes.html?highlight=pyobject_clearweakrefs#weak-reference-support which says The only further addition is that the destructor

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Updated patch. -- Added file: http://bugs.python.org/file25744/memoryview-weakref.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930 ___ ___ Python-bugs-list mailing list

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch. Looks good to me! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930 ___ ___

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset bc0281f85409 by Richard Oudkerk in branch 'default': Issue #14930: Make memoryview objects weakrefable. http://hg.python.org/cpython/rev/bc0281f85409 -- nosy: +python-dev

[issue14930] Make memoryview weakrefable

2012-05-27 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: The attached patch makes memoryview objects weakrefable. The reason I would like them to be weakrefable is so that I can manage the finalization and pickling of memoryview objects which wrap shared mmap segments. (It would be even better

[issue14930] Make memoryview weakrefable

2012-05-27 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Looks like an obviously good idea. The patch needs tests, though. -- nosy: +pitrou, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930