diff --git a/README.md b/README.md index 0c6ee21..d03bdc5 100644 --- a/README.md +++ b/README.md @@ -2061,6 +2061,7 @@ from queue import Queue Operator -------- +**Module of functions that provide the functionality of operators.** ```python from operator import add, sub, mul, truediv, floordiv, mod, pow, neg, abs from operator import eq, ne, lt, le, gt, ge diff --git a/index.html b/index.html index 7af620c..99b387a 100644 --- a/index.html +++ b/index.html @@ -1806,12 +1806,13 @@ lock.release() <el> = <Queue>.get() # Blocks until queue stops being empty. <el> = <Queue>.get_nowait() # Raises _queue.Empty exception if empty. -
from operator import add, sub, mul, truediv, floordiv, mod, pow, neg, abs
+#Operator
Module of functions that provide the functionality of operators.
from operator import add, sub, mul, truediv, floordiv, mod, pow, neg, abs
from operator import eq, ne, lt, le, gt, ge
from operator import and_, or_, not_
from operator import itemgetter, attrgetter, methodcaller
+
import operator as op
sorted_by_second = sorted(<collection>, key=op.itemgetter(1))
sorted_by_both = sorted(<collection>, key=op.itemgetter(1, 0))