Author pitrou
Recipients jcon, kermode, mark.dickinson, ncoghlan, petri.lehtinen, pitrou, pv, rupole, skrah, teoliphant, vstinner
Date 2011-07-05.15:46:40
SpamBayes Score 1.90348e-06
Marked as misclassified No
Message-id <1309880753.3683.36.camel@localhost.localdomain>
In-reply-to <>
> I thought the rationale for the release() method was to allow sequences like:
> b = bytearray()
> m1 = memoryview(b)
> m1.release() -> must call releasebuffer instantly.
> b.resize(10) -> this might fail otherwise if the garbage collection is too slow.

Well, that would still work with my proposal.
Now consider:

def some_library_function(byteslike):
    with memoryview(byteslike) as m2:
        # do something with m2

with memoryview(some_object) as m1:

That m1 becomes unusable after m2 is released in the library function is
completely counter-intuitive, and will make memoryviews a pain to use in
real life.
Date User Action Args
2011-07-05 15:46:41pitrousetrecipients: + pitrou, teoliphant, mark.dickinson, ncoghlan, rupole, kermode, vstinner, pv, skrah, jcon, petri.lehtinen
2011-07-05 15:46:40pitroulinkissue10181 messages
2011-07-05 15:46:40pitroucreate