homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Lluís
Recipients Lluís
Date 2013年11月21日.23:46:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1385077606.25.0.863226598696.issue19686@psf.upfronthosting.co.za>
In-reply-to
Content
The following code works without raising any AssertionError
 >>> n = "some small integer value"
 >>> m = "some larger integer value"
 >>> assert n<m
 >>> data = bytearray(n)
 >>> mem = memoryview(data)
 >>> assert mem==mem[:]
 >>> assert mem==mem[0:]
 >>> assert mem==mem[:m]
However, the different slices have different IDs, failing on the following asserts:
 >>> assert id(mem)==id(mem[:])
 >>> assert id(mem)==id(mem[0:])
 >>> assert id(mem)==id(mem[:m])
Is the interpreter copying unnecessary data in these type of slices?
History
Date User Action Args
2013年11月21日 23:46:46Lluíssetrecipients: + Lluís
2013年11月21日 23:46:46Lluíssetmessageid: <1385077606.25.0.863226598696.issue19686@psf.upfronthosting.co.za>
2013年11月21日 23:46:46Lluíslinkissue19686 messages
2013年11月21日 23:46:46Lluíscreate

AltStyle によって変換されたページ (->オリジナル) /