From f5eec903fa961135296e2656821450979e413248 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 23 Dec 2019 00:00:53 +1100 Subject: py/objsingleton: Use mp_generic_unary_op for singleton objects. So these types more closely match NoneType, eg they can be hashed, like in CPython. --- tests/basics/class_notimpl.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/basics/class_notimpl.py') diff --git a/tests/basics/class_notimpl.py b/tests/basics/class_notimpl.py index 308075f92f..58e790716b 100644 --- a/tests/basics/class_notimpl.py +++ b/tests/basics/class_notimpl.py @@ -48,3 +48,6 @@ except TypeError: # NotImplemented isn't handled specially in unary methods print(-c) + +# Test that NotImplemented can be hashed +print(type(hash(NotImplemented))) -- cgit v1.2.3