Message281740
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. |
|
Date |
User |
Action |
Args |
2016-11-25 22:00:36 | terry.reedy | set | recipients:
+ terry.reedy, gvanrossum, eric.smith, ned.deily, martin.panter, yselivanov |
2016-11-25 22:00:36 | terry.reedy | set | messageid: <1480111236.17.0.771684035276.issue28739@psf.upfronthosting.co.za> |
2016-11-25 22:00:36 | terry.reedy | link | issue28739 messages |
2016-11-25 22:00:35 | terry.reedy | create | |
|