From pykde Fri Apr 02 17:47:19 2021 From: Philippe Fremy Date: Fri, 02 Apr 2021 17:47:19 +0000 To: pykde Subject: How does QByteArray convert to bytes ? Message-Id: <49ee3e20-eabb-eec2-5113-1d092b569465 () freehackers ! org> X-MARC-Message: https://marc.info/?l=pykde&m=161738565019306 Hi, I am contributing to the PyQt5-stubs project, where we are providing the typing information for PyQt5. I recently contributed a __bytes__() method to the QByteArray type definition, to mark the fact that QByteArray can convert to bytes. But ... there is a verification step which fails because QByteArray does not contain any __bytes__ method. We have been trying to understand how the conversion is performed, without success. Could you give us a hint ? And is there a better way to mark the bytes() support than faking this __bytes__() method for mypy ? Thanks in advance, Philippe ps: thanks for the year-to-year energy that you put into PyQt bindings, it remains top quality !