We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50da40f commit d4e8928Copy full SHA for d4e8928
Doc/reference/lexical_analysis.rst
@@ -696,6 +696,17 @@ a temporary variable.
696
>>> f"newline: {newline}"
697
'newline: 10'
698
699
+Formatted string literals cannot be used as docstrings, even if they do not
700
+include expressions.
701
+
702
+::
703
704
+ >>> def foo():
705
+ ... f"Not a docstring"
706
+ ...
707
+ >>> foo.__doc__ is None
708
+ True
709
710
See also :pep:`498` for the proposal that added formatted string literals,
711
and :meth:`str.format`, which uses a related format string mechanism.
712
0 commit comments