{"push_id":3076248872,"size":3,"distinct_size":3,"ref":"refs/heads/skip_mk_memoryview","head":"719591b365c0aa1ac65db54efa2fb03543b5d70a","before":"543d368d71c9e52fccac6e0c896c32935bb20857","commits":[{"sha":"55670bc83cd7131228cb6b027a8f78e6f895d7db","author":{"name":"John Kirkham","email":"f62e5e898bee75be9eee0691c7e4e7a84b990c01@janelia.hhmi.org"},"message":"Use `self.obj` instead of `data`\n\nInstead of relying on the `data` object passed into `__cinit__`, use\n`self.obj`, which points to the `data` object provided. That way if we\ndecide to overwrite the `data` object, it shouldn't cause us any issues.","distinct":true,"url":"https://api.github.com/repos/jakirkham/cybuffer/commits/55670bc83cd7131228cb6b027a8f78e6f895d7db"},{"sha":"fc108d0dc3e68adee55a0b48f2036c99a908958c","author":{"name":"John Kirkham","email":"f62e5e898bee75be9eee0691c7e4e7a84b990c01@janelia.hhmi.org"},"message":"Skip creating a `memoryview` from `obj`\n\nAt this stage, there is no real value to creating a `memoryview` from\nour data to create an object vs. just using the buffer protocol to fill\nout our buffer. Under the hood, the `PyMemoryView_FromObject` call is\ndoing exactly what we are doing and providing little more. Filling out\nthe buffer directly avoids creating an intermediate object between our\nbuffer and the data. Not to mention this should make it easier for us to\nget access to the underlying object used to create the buffer. Also\nshould cutdown on the overhead of generating a `cybuffer` object.","distinct":true,"url":"https://api.github.com/repos/jakirkham/cybuffer/commits/fc108d0dc3e68adee55a0b48f2036c99a908958c"},{"sha":"719591b365c0aa1ac65db54efa2fb03543b5d70a","author":{"name":"John Kirkham","email":"f62e5e898bee75be9eee0691c7e4e7a84b990c01@janelia.hhmi.org"},"message":"Check (new) buffer protocol support on Python 2\n\nSkip checking to see if the object supports the (new) buffer protocol\nunless we are on Python 2. On Python 2/3, `PyObject_GetBuffer` already\nraises a `TypeError` with an informative message. This is also true of\n`PyBuffer_FromObject` on Python 2. So it is better to allow Python's\n`TypeError` messages to propagate up instead of adding our own. This\nkeeps the code simple for our use case with the same end effect. Also\nmakes the Python 3 case a little cleaner.\n\nOf course on Python 2 if the object doesn't support (new) buffer\nprotocol, it's good to figure that upfront as the check is cheap\ncompared to catching an exception. That way we can fallback to the\nbuffer protocol simply. Instead of carrying around a new object for\nstoring the result, just overwrite `data` as we already have a copy of\nit earlier and this won't affect anything outside of this function. Any\nexceptions that would be propagated on the Python 2 side are handled or\nnot just as before.","distinct":true,"url":"https://api.github.com/repos/jakirkham/cybuffer/commits/719591b365c0aa1ac65db54efa2fb03543b5d70a"}]}
{"actor":{"display_login":"jakirkham"}}