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
d4e89287
Commit
d4e89287
authored
Mar 10, 2017
by
Mariatta
Committed by
GitHub
Mar 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-28739: Document that f-strings cannot be used as docstring (GH-592)
parent
50da40fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Doc/reference/lexical_analysis.rst
Doc/reference/lexical_analysis.rst
+11
-0
No files found.
Doc/reference/lexical_analysis.rst
View file @
d4e89287
...
...
@@ -696,6 +696,17 @@ a temporary variable.
>>> f"newline: {newline}"
'newline: 10'
Formatted string literals cannot be used as docstrings, even if they do not
include expressions.
::
>>> def foo():
... f"Not a docstring"
...
>>> foo.__doc__ is None
True
See also :pep:`498` for the proposal that added formatted string literals,
and :meth:`str.format`, which uses a related format string mechanism.
...
...
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