[issue45958] Document typo in unpack_from()

Zachary Ware report at bugs.python.org
Wed Dec 1 23:22:57 EST 2021


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>
_______________________________________


More information about the Python-bugs-list mailing list