gh-115808: Add `is_none and is_not_none to operator` (#115814)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
Nico Mexis 2024-08-10 21:16:34 +02:00 committed by GitHub
parent 0fd97e46c7
commit 5580f31c56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 107 additions and 3 deletions

View file

@ -14,8 +14,8 @@ __all__ = ['abs', 'add', 'and_', 'attrgetter', 'call', 'concat', 'contains', 'co
'delitem', 'eq', 'floordiv', 'ge', 'getitem', 'gt', 'iadd', 'iand',
'iconcat', 'ifloordiv', 'ilshift', 'imatmul', 'imod', 'imul',
'index', 'indexOf', 'inv', 'invert', 'ior', 'ipow', 'irshift',
'is_', 'is_not', 'isub', 'itemgetter', 'itruediv', 'ixor', 'le',
'length_hint', 'lshift', 'lt', 'matmul', 'methodcaller', 'mod',
'is_', 'is_none', 'is_not', 'is_not_none', 'isub', 'itemgetter', 'itruediv',
'ixor', 'le', 'length_hint', 'lshift', 'lt', 'matmul', 'methodcaller', 'mod',
'mul', 'ne', 'neg', 'not_', 'or_', 'pos', 'pow', 'rshift',
'setitem', 'sub', 'truediv', 'truth', 'xor']
@ -66,6 +66,14 @@ def is_not(a, b):
"Same as a is not b."
return a is not b
def is_none(a):
"Same as a is None."
return a is None
def is_not_none(a):
"Same as a is not None."
return a is not None
# Mathematical/Bitwise Operations *********************************************#
def abs(a):