kopia lustrzana https://github.com/micropython/micropython-lib
operator: Add bunch of operator synonym functions.
As used by datetime test from CPython.pull/211/head
rodzic
c9471276b3
commit
c8a3bb6d0e
|
@ -3,3 +3,31 @@ def attrgetter(attr):
|
|||
def _attrgetter(obj):
|
||||
return getattr(obj, attr)
|
||||
return _attrgetter
|
||||
|
||||
|
||||
def lt(a, b):
|
||||
return a < b
|
||||
|
||||
def le(a, b):
|
||||
return a <= b
|
||||
|
||||
def gt(a, b):
|
||||
return a > b
|
||||
|
||||
def ge(a, b):
|
||||
return a >= b
|
||||
|
||||
def eq(a, b):
|
||||
return a == b
|
||||
|
||||
def ne(a, b):
|
||||
return a != b
|
||||
|
||||
def mod(a, b):
|
||||
return a % b
|
||||
|
||||
def truediv(a, b):
|
||||
return a / b
|
||||
|
||||
def floordiv(a, b):
|
||||
return a // b
|
||||
|
|
Ładowanie…
Reference in New Issue