diff options
author | Damien George <damien@micropython.org> | 2023-10-13 15:27:05 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-10-13 15:29:09 +1100 |
commit | 516385c4ccbb1f7fa9dbd37a44ed8ae33dcf1942 (patch) | |
tree | 393190e62acf5e41c3154987e7ca2985b523b03b /tests/basics/boundmeth1.py | |
parent | 66c62353ce35d72d7322740ad88f3c4986f31e64 (diff) | |
download | micropython-516385c4ccbb1f7fa9dbd37a44ed8ae33dcf1942.tar.gz micropython-516385c4ccbb1f7fa9dbd37a44ed8ae33dcf1942.zip |
py/objboundmeth: Optimise check for types in binary_op.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'tests/basics/boundmeth1.py')
-rw-r--r-- | tests/basics/boundmeth1.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/boundmeth1.py b/tests/basics/boundmeth1.py index e72153a41a..fe1b454688 100644 --- a/tests/basics/boundmeth1.py +++ b/tests/basics/boundmeth1.py @@ -33,6 +33,8 @@ try: except AttributeError: print("AttributeError") +print("--------") + # bound method comparison with same object a = A() m1 = a.f @@ -51,6 +53,14 @@ print(m1 == a2.f) # should result in False print(m2 == a1.f) # should result in False print(m1 != a2.f) # should result in True +# bound method comparison with non-bound-method objects +print(A().f == None) # should result in False +print(A().f != None) # should result in True +print(None == A().f) # should result in False +print(None != A().f) # should result in True + +print("--------") + # bound method hashing a = A() m1 = a.f |