[issue22823] Use set literals instead of creating a set from a list

Raymond Hettinger report at bugs.python.org
Sun Nov 9 21:17:49 CET 2014


Raymond Hettinger added the comment:

[Isn't such changes considered code churn?]

This sort of thing is always a judgment call.  The patch will affect very few lines of code, give a little speed-up, and make the code easier to read.  In the case of the docs, it is almost always worthwhile to update to the current, idiomatic form.  Also, the set literal case is special because it has built-in language support, possible peephole optimizations, and there was a repr change as well.  That said, it is rarely a good idea to change tests because we don't have tests for tests and because the end-user will never see any value.

On the balance, I think this one is a reasonable thing to do, but I would show a great deal more hesitancy for a "a huge patch which makes Python sources to use more modern idioms."

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22823>
_______________________________________


More information about the Python-bugs-list mailing list