[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah added the comment: r75484 should be b595e1ad5722. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah 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 addresses #1469629. I've go

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Richard Oudkerk
Richard Oudkerk added the comment: Is it possible that the use of test.support.gc_collect() in test_memoryview made the difference? -- ___ Python tracker ___ __

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Stefan Krah
Stefan Krah 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-05-29 Thread Richard Oudkerk
Changes by Richard Oudkerk : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Roundup Robot
Roundup Robot 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 ___ Python tracker

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Updated patch. Looks good to me! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue14930] Make memoryview weakrefable

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

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou 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 needs to c

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Charles-François Natali
Charles-François Natali 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 that. --

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Richard Oudkerk
Richard Oudkerk 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 only once. (I kno

[issue14930] Make memoryview weakrefable

2012-05-28 Thread Antoine Pitrou
Antoine Pitrou 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 the buffer being

[issue14930] Make memoryview weakrefable

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

[issue14930] Make memoryview weakrefable

2012-05-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: Looks like an obviously good idea. The patch needs tests, though. -- nosy: +pitrou, skrah ___ Python tracker ___ __

[issue14930] Make memoryview weakrefable

2012-05-27 Thread Richard Oudkerk
New submission from Richard Oudkerk : 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 if memoryview were