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 martin.panter
Recipients Dustin.Oprea, beng94, martin.panter, meador.inge
Date 2016-02-04.22:45:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1454625910.39.0.74239071992.issue21328@psf.upfronthosting.co.za>
In-reply-to
Content
I’m not sure if resize() should change the len(). Dustin, why do you think it should? Not all ctypes objects even implement len(). The len() of 10 seems embedded in the class of the return value:

>>> b
<ctypes.c_char_Array_10 object at 0x7f143362fd90>

Also, how would this affect create_unicode_buffer(), if the buffer is resized to a non-multiple of sizeof(c_wchar)?

Gedai: I’m not that familiar with the ctypes internals, but it looks like __len__() is implemented on the Array base class:

>>> type(b).__len__
<slot wrapper '__len__' of '_ctypes.Array' objects>

Maybe look for the implementation of this method: <https://docs.python.org/3/c-api/typeobj.html#c.PySequenceMethods.sq_length>.
History
Date User Action Args
2016-02-04 22:45:10martin.pantersetrecipients: + martin.panter, meador.inge, Dustin.Oprea, beng94
2016-02-04 22:45:10martin.pantersetmessageid: <1454625910.39.0.74239071992.issue21328@psf.upfronthosting.co.za>
2016-02-04 22:45:10martin.panterlinkissue21328 messages
2016-02-04 22:45:10martin.pantercreate