New submission from Terry J. Reedy <tjre...@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') b'\x00aa' >>> struct.pack('1s1s1s', b'', b'a', b'ab') b'\x00aa' ---------- 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 <rep...@bugs.python.org> <http://bugs.python.org/issue11436> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com