Guido van Rossum wrote:
> I personally think F-strings should not be usable as docstrings. If you
> want a dynamically calculated docstring you should assign it dynamically,
> not smuggle it in using a string-like expression. We don't allow "blah {x}
> blah".format(x=1) as a docstring either, not
On Tue, Jan 11, 2022 at 6:24 PM Guido van Rossum wrote:
> I personally think F-strings should not be usable as docstrings. If you
> want a dynamically calculated docstring you should assign it dynamically,
> not smuggle it in using a string-like expression. We don't allow "blah {x}
>
On Thu, 13 Jan 2022 at 02:31, Steven Barker wrote:
>
> While f-strings in class scope could theoretically be valid docstrings a lot
> of the time, the equivalent situation for function docstrings is much less
> positive. A function like this the one below obviously problematic, since the
>
On Wed, Jan 12, 2022 at 2:58 AM Neil Muller
wrote:
> Having something that looks like it sets the docstring, but silently
> doesn't is very surprising, though. Linters can warn about this, but
> linters are not a universal fix, and this is something that
> superficially looks entirely
On Wed, 12 Jan 2022 at 00:12, Eric V. Smith wrote:
>
> On 1/11/2022 3:44 PM, Brett Cannon wrote:
>
>
>
> >>> class C: 'foo'
> ...
> >>> C.__doc__ == 'foo'
> True
>
> >>> class C: f'foo'
> ...
> >>> C.__doc__ == 'foo'
> False
> >>> C.__doc__ is None
> True
>
> And there's a test to make sure
On 1/11/2022 3:44 PM, Brett Cannon wrote:
On Tue, Jan 11, 2022 at 10:40 AM Gregory P. Smith wrote:
On Tue, Jan 11, 2022 at 10:29 AM Guido van Rossum
wrote:
I personally think F-strings should not be usable as
docstrings. If you want a dynamically calculated
On Tue, Jan 11, 2022 at 10:40 AM Gregory P. Smith wrote:
>
> On Tue, Jan 11, 2022 at 10:29 AM Guido van Rossum
> wrote:
>
>> I personally think F-strings should not be usable as docstrings. If you
>> want a dynamically calculated docstring you should assign it dynamically,
>> not smuggle it in
On Tue, Jan 11, 2022 at 10:29 AM Guido van Rossum wrote:
> I personally think F-strings should not be usable as docstrings. If you
> want a dynamically calculated docstring you should assign it dynamically,
> not smuggle it in using a string-like expression. We don't allow "blah {x}
>
I personally think F-strings should not be usable as docstrings. If you
want a dynamically calculated docstring you should assign it dynamically,
not smuggle it in using a string-like expression. We don't allow "blah {x}
blah".format(x=1) as a docstring either, not "foo %s bar" % x.
On Tue, Jan
On Tue, 11 Jan 2022 10:58:03 -0500
"Eric V. Smith" wrote:
> Constant f-strings (those without substitutions) as doc strings used to
> work, since the compiler turns them into normal strings.
>
> I can't find exactly where it was removed, but there was definitely
> discussion about it. See
Constant f-strings (those without substitutions) as doc strings used to
work, since the compiler turns them into normal strings.
I can't find exactly where it was removed, but there was definitely
discussion about it. See https://bugs.python.org/issue28739 for at least
part of the discussion.
11 matches
Mail list logo