error in documentation for struct

Thanks for being a volunteer and helping to make Python more perfect. In the documentation for struct.unpack_from I think there is an error: the "/" should not be present? https://docs.python.org/3/library/struct.html struct.unpack_from(format, /, buffer, offset=0) [cid:image003.jpg@01D7ED1A.8570BE10] regards, Neal.

Hiya! The / is specifying that "format" is a positional-only argument to the function. You can learn more about what that means here: https://docs.python.org/3/tutorial/controlflow.html#special-parameters Best, Pradyun PS: I appreciate that you sent the text form of the function signature as well as a link to the page, in addition to a screenshot of the function. That made it easier to read and look up what exactly you're asking about. :) On Sun, Dec 12, 2021 at 1:47 PM Neal Crook <Neal.Crook@onsemi.com> wrote:
Thanks for being a volunteer and helping to make Python more perfect. In the documentation for struct.unpack_from I think there is an error: the "/" should not be present?
https://docs.python.org/3/library/struct.html
struct.unpack_from(*format*, */*, *buffer*, *offset=0*)
regards,
Neal.
_______________________________________________ docs mailing list -- docs@python.org To unsubscribe send an email to docs-leave@python.org https://mail.python.org/mailman3/lists/docs.python.org/ Member address: pradyunsg@gmail.com

Hi Arthur, Pradyun, Thank you both for your helpful emails and the links/references. I realise now that I made an elementary rookie error in thinking that this was a typo, and I can see the purpose/importance of this notation. In answer to Arthur's question: my first attempt to use 'unpack_from' failed because I included the "/" literally in my call. I got it working on the second try by removing the slash and then I thought I'd be a good citizen by reporting the typo ☹ regards, Neal. From: Pradyun Gedam <pradyunsg@gmail.com> Sent: 13 December 2021 09:11 To: Neal Crook <Neal.Crook@onsemi.com> Cc: docs@python.org Subject: Re: [docs] error in documentation for struct [External Email]: This email arrived from an external source - Please exercise caution when opening any attachments or clicking on links. Hiya! The / is specifying that "format" is a positional-only argument to the function. You can learn more about what that means here: https://docs.python.org/3/tutorial/controlflow.html#special-parameters<https://urldefense.com/v3/__https:/docs.python.org/3/tutorial/controlflow.html*special-parameters__;Iw!!KkVubWw!zXRWO2GefGCvzGpv3_DhtcjV4YidrXyBsH6HEg3_Byw6aZ5PM7nuJMvixL7ZUJYb$> Best, Pradyun PS: I appreciate that you sent the text form of the function signature as well as a link to the page, in addition to a screenshot of the function. That made it easier to read and look up what exactly you're asking about. :) On Sun, Dec 12, 2021 at 1:47 PM Neal Crook <Neal.Crook@onsemi.com<mailto:Neal.Crook@onsemi.com>> wrote: Thanks for being a volunteer and helping to make Python more perfect. In the documentation for struct.unpack_from I think there is an error: the "/" should not be present? https://docs.python.org/3/library/struct.html<https://urldefense.com/v3/__https:/docs.python.org/3/library/struct.html__;!!KkVubWw!zXRWO2GefGCvzGpv3_DhtcjV4YidrXyBsH6HEg3_Byw6aZ5PM7nuJMvixK9n-5_I$> struct.unpack_from(format, /, buffer, offset=0) [cid:image003.jpg@01D7F005.0F2E8A50] regards, Neal. _______________________________________________ docs mailing list -- docs@python.org<mailto:docs@python.org> To unsubscribe send an email to docs-leave@python.org<mailto:docs-leave@python.org> https://mail.python.org/mailman3/lists/docs.python.org/<https://urldefense.com/v3/__https:/mail.python.org/mailman3/lists/docs.python.org/__;!!KkVubWw!zXRWO2GefGCvzGpv3_DhtcjV4YidrXyBsH6HEg3_Byw6aZ5PM7nuJMvixLJTYyv_$> Member address: pradyunsg@gmail.com<mailto:pradyunsg@gmail.com>
participants (2)
-
Neal Crook
-
Pradyun Gedam