Guido van Rossum added the comment:

I don't really care that much, but I personally think that it would be more 
consistent (and a simpler rule) if *no* f-string (not even ones without 
substitutions) were to be allowed as docstrings.

In all other examples that Raymond shows it's the syntactic form that matters 
-- no on b-strings, yes on r-strings, yes on concatenation (using space), no on 
+, etc.

The language reference clearly defines f-strings as all strings with an 
f-prefix, and says that they *may* contain replacement fields.  So it's clear 
that an f-string without replacements is still an f-string, and it is still 
distinguished from other strings.  Hence I think it should not be allowed as a 
docstring.

(Also, what purpose could using the f-prefix for a docstring possibly have?  
All the other allowable combinations do have a use.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28739>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to