Martin Panter added the comment:
Actually, testing your code fragment, it seems you do get a doc string when the
f-string has no substitutions in curly brackets, otherwise you don’t get any
doc string. Maybe this is due to how different forms of string are compiled.
>>> class Foo:
... f'spam' # Compiled as plain 'spam'
...
>>> Foo.__doc__
'spam'
>>> class Foo:
... 'spam' f'{"MMM"}' # Compiled as f'spam{"MMM"}'
...
>>> Foo.__doc__ is None
True
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28739>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com