This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients eric.smith, gvanrossum, martin.panter, ned.deily, terry.reedy, yselivanov
Date 2016-11-25.22:00:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480111236.17.0.771684035276.issue28739@psf.upfronthosting.co.za>
In-reply-to
Content
Much of this discussion seems to duplicate and effectively re-open of #25179, wherein it was decided/accepted that true, non-degenerate, non-trivial, non-constant, f-strings that actually do formatting are not constants and do not and should not become docstrings.  I agree.  I think this issue should either be closed as 'not a bug' or redefined as a doc issue.

It was noted by Martin P. in #25179 that "a constant f-string without any interpolations does become a doc string."  That is because such is really a string literal and not really an f-string, in the same sense that 'circle of radius 0' is really a point and not a circle.

The current glossary entry is

"docstring
    A string literal which appears as the first expression in a class, function or module. While ignored when the suite is executed, it is recognized by the compiler and put into the __doc__ attribute of the enclosing class, function or module. Since it is available via introspection, it is the canonical place for documentation of the object."

I suggest adding "Bytestring literals and non-trivial f-strings do not become docstrings." as the second sentence.
History
Date User Action Args
2016-11-25 22:00:36terry.reedysetrecipients: + terry.reedy, gvanrossum, eric.smith, ned.deily, martin.panter, yselivanov
2016-11-25 22:00:36terry.reedysetmessageid: <1480111236.17.0.771684035276.issue28739@psf.upfronthosting.co.za>
2016-11-25 22:00:36terry.reedylinkissue28739 messages
2016-11-25 22:00:35terry.reedycreate