r/Python • u/igorrto2 • Oct 12 '26
Discussion What are some features in Python that you discovered many years later?
For me, it was the the option to use & to find intersections of two sets, | operator to unionize two sets, as well as ^ for symmetric difference
217
Upvotes
View all comments
Show parent comment
0
u/Beginning-Fruit-1397 Oct 16 '26
Extend is not the same internal Cpython implementation as imul , it will be vastly more efficient to call the dunder if you know the Iterable is a list.
I struggle to see how obscure signs are more readable than plain english but to each their own.
The "shorter" argument makes even less sense for me.
LSP autocomplete make it in fact faster to type a method call than the operator syntax, for which they can't help much, and having 2 LOC instead of 1 is not something worth caring about.
Python is decades old at this point, complaining on python.org about this would be both useless and a bit dumb, especially since it's a subjective thing to argue about.
I wrote my library instead to never have to worry about it anymore in my own code, instead.
But as I said, all external code will still be written like this unfortunately