typed_python icon indicating copy to clipboard operation
typed_python copied to clipboard

'is' fails inside a Class

Open guslonergan opened this issue 4 years ago • 1 comments

class A(Class):
    def f(self, other) -> bool:
        return self is other

x = A()
print(x is x) # this gives True
print(x.f(x)) # this gives False

guslonergan avatar Apr 08 '20 16:04 guslonergan

This is not going to work any time soon.

Sent from my iPhone

On Apr 8, 2020, at 12:02 PM, guslonergan [email protected] wrote:

 class A(Class): def f(self, other) -> bool: return self is other

x = A() print(x is x) # this gives True print(x.f(x)) # this gives False — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

braxtonmckee avatar Apr 08 '20 16:04 braxtonmckee