[docs] [issue28739] PEP 498: docstrings as f-strings

Joakim Soderlund report at bugs.python.org
Sat Feb 11 19:40:00 EST 2017


Joakim Soderlund added the comment:

I got slightly confused here while playing around.

Python 3.6.0 (default, Jan 31 2017, 11:39:39) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Huacaya:
...   f"""Huacaya!"""
... 
>>> class Suri:
...   f"""{'Suri!'}"""
... 
>>> Huacaya.__doc__ is None
False
>>> Suri.__doc__ is None
True

At first I thought f-strings *did* work as docstrings since it worked  just fine for the first class. But, the docstring suddenly vanished when putting an actual expression into it.

----------
nosy: +JockeTF

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28739>
_______________________________________


More information about the docs mailing list