Repository navigation
gh-151950: Fix dangling class reference in pickletools docs #152209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,11 +107,47 @@ Programmatic interface | |
| .. function:: genops(pickle) | ||
|
|
||
| Provides an :term:`iterator` over all of the opcodes in a pickle, returning a | ||
| sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of an | ||
| :class:`OpcodeInfo` class; *arg* is the decoded value, as a Python object, of | ||
| the opcode's argument; *pos* is the position at which this opcode is located. | ||
| sequence of ``(opcode, arg, pos)`` triples. *opcode* is an instance of | ||
| :class:`OpcodeInfo`; *arg* is the decoded value, as a Python object, of the | ||
| opcode's argument; *pos* is the position at which this opcode is located. | ||
| *pickle* can be a string or a file-like object. | ||
|
|
||
| .. class:: OpcodeInfo | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docs WG monthly meeting triage: please either add these |
||
|
|
||
| Represents information about a pickle opcode. | ||
|
|
||
| Instances of this class are returned as the first element of the tuples | ||
| yielded by :func:`genops`. | ||
|
|
||
| .. attribute:: name | ||
|
|
||
| The symbolic name of the opcode. | ||
|
|
||
| .. attribute:: code | ||
|
|
||
| The one-character opcode value. | ||
|
|
||
| .. attribute:: arg | ||
|
|
||
| The descriptor for the opcode argument, or ``None`` if the opcode has | ||
| no argument. | ||
|
|
||
| .. attribute:: stack_before | ||
|
|
||
| A list describing the stack before the opcode executes. | ||
|
|
||
| .. attribute:: stack_after | ||
|
|
||
| A list describing the stack after the opcode executes. | ||
|
|
||
| .. attribute:: proto | ||
|
|
||
| The pickle protocol version in which the opcode was introduced. | ||
|
|
||
| .. attribute:: doc | ||
|
|
||
| A human-readable description of the opcode. | ||
|
|
||
| .. function:: optimize(picklestring) | ||
|
|
||
| Returns a new equivalent pickle string after eliminating unused ``PUT`` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert the change moving "the" let's not have churn. Also we can remove the "an" before
OpcodeInfo.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs WG monthly meeting triage: please move "the" back.