[SciPy-Dev] F strings in codebase?

Terry terry.y.davis+scipy at gmail.com
Fri Jul 3 16:09:42 EDT 2020


We could start using git's blame.ignoreRevsFile, which would hide the code
churn*.

*only on the client side until github supports this feature.
If you want to push github to add this feature, reference this gitlab issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/31423

see: https://github.com/ipython/ipython/pull/12091/files


-Terry



On Fri, Jul 3, 2020 at 12:40 PM Warren Weckesser <warren.weckesser at gmail.com>
wrote:

> On 7/3/20, rlucas7 at vt.edu <rlucas7 at vt.edu> wrote:
> > Hi SciPy-dev,
> >
> > On reviewing this pr:
> >
> > https://github.com/scipy/scipy/pull/12376
> >
> > cool-RR was asking about whether f strings are ok in scipy now. I wasn’t
> > sure and couldn’t find any, nor clear documentation on a preferred
> format.
>
>
> Yes, f-strings are acceptable now.
>
> But I don't think we want to go back and convert all uses of .format()
> and '%' to f-strings.  The benefit is probably not worth the code
> churn.  So for now, it is probably best to use f-strings in new code,
> and when updating old code for some other reason.  E.g. if some
> additional information is added to the message of exception, and the
> old code uses '%', it would be fine to change it to use an f-string.
>
> Other devs may have different opinions about that, so let's see what
> others say before that is considered official policy.
>
> Warren
>
>
> >
> > I know different (parts) of different sub packages may use ‘%’ for
> > interpolation and others use .format()
> >
> > I poked around trying to find examples in codebase but GitHub searching
> for
> > f” didn’t give anything, nor did I find anything in the hacking file or
> > related links.
> >
> > Do we have a preferred string interpolation method for SciPy?
> >
> > Note the discussion of the string interpolation is about a potential
> follow
> > up PR that cool-RR may do and not the Linked PR itself.
> >
> > Sincerely,
> >
> > -Lucas Roberts
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20200703/27d1d3ea/attachment.html>


More information about the SciPy-Dev mailing list