This codemod converts Python set constructions using literal list arguments into more efficient and readable set literals. It simplifies expressions like set([1, 2, 3]) to {1, 2, 3}, enhancing both performance and code clarity.
Our changes look like this:
-x = set([1, 2, 3])
+x = {1, 2, 3}
I have additional improvements ready for this repo! If you want to see them, leave the comment:
This codemod converts Python set constructions using literal list arguments into more efficient and readable set literals. It simplifies expressions like
set([1, 2, 3])
to{1, 2, 3}
, enhancing both performance and code clarity.Our changes look like this:
I have additional improvements ready for this repo! If you want to see them, leave the comment:
... and I will open a new PR right away!
Powered by: pixeebot (codemod ID: pixee:python/use-set-literal)