[Python-Dev] Minor inconvenience: f-string not recognized as docstring

2022年1月11日 05:46:52 -0800

Hello,
Currently, a f-string is not recognized as a docstring:
>>> class C: f"foo"
>>> C.__doc__
>>> 
This means you need to use a (admittedly easy) workaround:
>>> class C: __doc__ = f"foo"
>>> C.__doc__
'foo'
Shouldn't the former be allowed for convenience?
Regards
Antoine.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/UALMEMQ4QW7W4HE2PIBARWYBKFWJZFB4/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to