//
sign in
Post
by @danabra.mov
PostEmbed
by @danabra.mov
Record
by @jimpick.com
Record
by @atsui.org
+ new component
Post
`operator.itemgetter` and `attrgetter` get under-used IMO. Same goes for `else` clauses on `for` and `while` loops.
20d
Brett Cannon
Python Tip #148 (of 365): Sort by specific sequence items with operator.itemgetter 🧵 Have an iterable of sequences (tuples, lists, etc.)? You can sort them by one or more of their indexes using itemgetter from Python's operator module. from operator import itemgetter #Python #DailyPythonTip