[New-bugs-announce] [issue11436] Clarify struct doc for format 's'.

Terry J. Reedy report at bugs.python.org
Mon Mar 7 19:29:38 CET 2011

New submission from Terry J. Reedy <tjreedy at udel.edu>:

The struct doc does not specify the meaning of 's', without a count. The attached patch adds the sentence:

 If a count is not given, it defaults to 1; ``'s'`` means the same as ``'1s'``.

(Until I experimented, I had thought no count meant indefinite length).

>>> struct.pack('sss', b'', b'a', b'ab')
>>> struct.pack('1s1s1s', b'', b'a', b'ab')

messages: 130275
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: Clarify struct doc for format 's'.
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list