[issue45958] Document typo in unpack_from()

Hian-Kun Tenn report at bugs.python.org
Thu Dec 2 01:00:20 EST 2021


Hian-Kun Tenn <hiankun at gmail.com> added the comment:

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 at bugs.python.org> wrote:

>
> Zachary Ware <zachary.ware at 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 at bugs.python.org>
> <https://bugs.python.org/issue45958>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45958>
_______________________________________


More information about the Python-bugs-list mailing list