[Numpy-discussion] what to clean up, what to leave as is
sebastian at sipsolutions.net
Fri Jan 24 13:15:03 EST 2020
On Fri, 2020-01-24 at 10:57 -0700, Charles R Harris wrote:
> On Fri, Jan 24, 2020 at 10:42 AM Kevin Sheppard <
> kevin.k.sheppard at gmail.com> wrote:
> > I think some types of clean-ups, for example, imports, are pretty
> > low cost, low risk and don't have much bearing on and it might be
> > best to do them all at once.
> > f-strings are also pretty simple but can be abused to the detriment
> > of code around (for example, moving a string defined in a variable
> > outside a function into the function just so it can have an f-
> > string).
> > I think more general code clean-up, for example, removing list
> > around iterators (e.g., list(map(f, i)) should be mostly avoided
> > unless there is a compelling case to prefer the iterator for
> > performance reasons.
> I tend to see that as a matter of timing. At some point such things
> become archaic and unfamiliar as developers who grew up with modern
> Python become more common. But there is no rush.
Honestly, I am OK with simply not cleaning up some stuff. It was a
But, if we ever get around doing it, it seems like a good time now when
we already have a big code churn do to Py2 removal.
> The problem with code history is trickier, and almost unavoidable
> over time. The information is still there, but it is harder to dig it
> out. Probably there need to be better tools to deal with that. This
> is especially apparent from the early C code cleanup that I did just
> to get more modern and readable code styling. My name is all over
> code that I didn't write, just formatted. But the cleanup was
> necessary for maintenance if nothing else.
Code history is a problem and it is annoying that code attribution is
obfuscated by it.
The argument for doing style cleanups is that if we do not use modern
patterns in large chunks of the code, the old patterns are likely to
repeated indefinitely. At least within their files .
Tools are maybe getting a bit better (e.g. github allows to click on
"view blame before this, although I doubt we ever get somewhere were
they will figure out that something was "just" a style cleanup.
 An example are pytest vs. nose testing styles, where it is unlikely
we ever lose the complexity of keeping random snippets of nose style
around (which definitely will confuse new contributors).
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: This is a digitally signed message part
More information about the NumPy-Discussion