[issue36065] Add unified C API for accessing bytes and bytearray

Ori Avtalion report at bugs.python.org
Thu Feb 21 10:44:11 EST 2019


Ori Avtalion <ori at avtalion.name> added the comment:

My use-case is modifying existing code that supports bytes to also support bytearray.

https://github.com/mongodb/mongo-python-driver/blob/9902d239b4e557c2a657e8c8110f7751864cec95/bson/_cbsonmodule.c#L1112

The buffer protocol, which I didn't know of, feels slightly complicated for my use-case. For now I opted to adding these macros myself, only changing 3 lines.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36065>
_______________________________________


More information about the Python-bugs-list mailing list