Hey all,

I'd like to work on cutting down the number of unused imports; a sample pull request is on https://github.com/sympy/sympy/pull/8761 .

The questions I'd like to discuss is why this should be done, and how this should be done.

On the "why":
01) It's needless clutter in the code. People can't look into the import list to determine the true intermodule dependencies. (+1)
02) Over time, unneeded imports tend to create import cycles. (+1)
03) More imports make refactoring harder that are affected by module dependencies. Unneeded imports make such tasks gratuitiously harder. This affects things like eliminating C (actually that's the reason why I'm looking at imports at all). (+1) 04) I do not know whether it is possible to have an automated test for unused imports. It may restrict our ability to import stuff depending on runtime decisions, but I don't really know whether these restrictions will hurt or won't matter. I hope to find that out by eliminating imports one by one and seeing whether the test suite fails. (+0) 05) Do we want to eliminate all unused imports, as a code quality check? It would be desirable to prevent inadvertent import cycles, but we may not want the restrictions that come with it. (Depends on 04)

On the "how" (assuming the "why" resolves to "yes we want that work done"):
10) Should the modification be rolled into one PR, or do people prefer smaller PRs? What's the ideal size?

Some general remarks:
20) PyDev is telling me about ~1200 unused imports in the sympy module. 150 are in sympy.mpmath, so they're irrelevant; I don't know how many of these are false positives. 21) For stuff outside of sympy (i.e. bin, build etc): I'm currently leaving that alone because I don't know how to test whether a modification there breaks anything.

Any feedback appreciated.

Regards,
Jo

--
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/54AD0751.7020109%40durchholz.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to