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.

Title: Add PyBuffer_SizeFromFormat() C helper for struct.calcsize()
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: ellery.newcomer, vstinner
Priority: normal Keywords: patch

Created on 2012-09-10 21:27 by ellery.newcomer, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 13873 merged nanjekyejoannah, 2019-06-06 20:50
Messages (4)
msg170239 - (view) Author: Ellery Newcomer (ellery.newcomer) Date: 2012-09-10 21:27
this function is listed in the buffer docs and in abstract.h, but there is no implementation anywhere.
msg170269 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-09-11 07:22
Even though it's documented, the function is probably a new feature
and should go into 3.4.

Meanwhile, you can call struct.calcsize(format). Any non-trivial
implementation of PyBuffer_SizeFromFormat() would likely do the same.
msg350007 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-20 14:46
New changeset 9e66aba99925eebacfe137d9deb0ef1fdbc2d5db by Victor Stinner (Joannah Nanjekye) in branch 'master':
bpo-15913: Implement PyBuffer_SizeFromFormat() (GH-13873)
msg350008 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-08-20 14:47
Joannah Nanjekye implemented the function, thanks.
Date User Action Args
2022-04-11 14:57:35adminsetgithub: 60117
2019-08-20 14:47:47vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg350008

stage: patch review -> resolved
2019-08-20 14:46:49vstinnersetnosy: + vstinner
messages: + msg350007
2019-06-07 16:50:36vstinnersettitle: PyBuffer_SizeFromFormat is missing -> Add PyBuffer_SizeFromFormat() C helper for struct.calcsize()
versions: + Python 3.9, - Python 3.6
2019-06-06 20:50:32nanjekyejoannahsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request13751
2016-05-19 15:52:53berker.peksagsetstage: needs patch
versions: + Python 3.6, - Python 3.4
2014-10-14 18:05:09skrahsetnosy: - skrah
2012-09-11 07:22:48skrahsetversions: + Python 3.4, - Python 3.1, Python 2.7
nosy: + skrah

messages: + msg170269

components: + Interpreter Core, - None
type: enhancement
2012-09-10 21:27:23ellery.newcomercreate