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.

classification
Title: Document typo in unpack_from()
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.9
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, hiankun, zach.ware
Priority: normal Keywords:

Created on 2021-12-02 02:45 by hiankun, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg407510 - (view) Author: Hian-Kun Tenn (hiankun) Date: 2021-12-02 02:45
In the document of "struct" (https://docs.python.org/3.9/library/struct.html#struct.unpack_from), there's typo in it.

The document read
`struct.unpack_from(format, /, buffer, offset=0)`
and I believe it should be
`struct.unpack_from(format, buffer, offset=0)`.

Documents before Python 3.9 has no this typo.
msg407511 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-12-02 04:22
The `/` denotes that `format` is a positional-only argument; you cannot make a call like `struct.unpack_from(format=my_format, buffer=my_buffer)`, it must be `struct.unpack_from(my_format, buffer=my_buffer)` or `struct.unpack_from(my_format, my_buffer)`.  The same syntax can be used to define your own function with positional-only arguments, see https://docs.python.org/3/tutorial/controlflow.html#positional-only-parameters or https://docs.python.org/3/reference/compound_stmts.html#function-definitions
msg407512 - (view) Author: Hian-Kun Tenn (hiankun) Date: 2021-12-02 06:00
Hi,

I didn't know that and feel sorry to bother you with the non-bug "issue."

Thank you for the quick and thoughtful reply. :-)

Hiankun

On Thu, Dec 2, 2021 at 12:23 PM Zachary Ware <report@bugs.python.org> wrote:

>
> Zachary Ware <zachary.ware@gmail.com> added the comment:
>
> The `/` denotes that `format` is a positional-only argument; you cannot
> make a call like `struct.unpack_from(format=my_format, buffer=my_buffer)`,
> it must be `struct.unpack_from(my_format, buffer=my_buffer)` or
> `struct.unpack_from(my_format, my_buffer)`.  The same syntax can be used to
> define your own function with positional-only arguments, see
> https://docs.python.org/3/tutorial/controlflow.html#positional-only-parameters
> or
> https://docs.python.org/3/reference/compound_stmts.html#function-definitions
>
> ----------
> nosy: +zach.ware
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue45958>
> _______________________________________
>
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90116
2021-12-02 06:00:20hiankunsetmessages: + msg407512
2021-12-02 04:22:57zach.waresetstatus: open -> closed

nosy: + zach.ware
messages: + msg407511

resolution: not a bug
stage: resolved
2021-12-02 02:45:07hiankuncreate