Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
281d5321
Commit
281d5321
authored
Nov 03, 2015
by
Eric V. Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 25483: Update dis.rst with FORMAT_VALUE opcode description.
parent
a78c7954
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
Doc/library/dis.rst
Doc/library/dis.rst
+19
-0
No files found.
Doc/library/dis.rst
View file @
281d5321
...
@@ -989,6 +989,25 @@ the more significant byte last.
...
@@ -989,6 +989,25 @@ the more significant byte last.
arguments.
arguments.
.. opcode:: FORMAT_VALUE (flags)
Used for implementing formatted literal strings (f-strings). Pops
an optional *fmt_spec* from the stack, then a required *value*.
*flags* is interpreted as follows:
* ``(flags & 0x03) == 0x00``: *value* is formattedd as-is.
* ``(flags & 0x03) == 0x01``: call :func:`str` on *value* before
formatting it.
* ``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before
formatting it.
* ``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before
formatting it.
* ``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use
it, else use an empty *fmt_spec*.
Formatting is performed using the :c:func:`PyObject_Format` function.
.. opcode:: HAVE_ARGUMENT
.. opcode:: HAVE_ARGUMENT
This is not really an opcode. It identifies the dividing line between
This is not really an opcode. It identifies the dividing line between
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment