You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
programming-basics-2022/08_python/magic/MyHashable.py

8 lines
190 B

from abc import ABC
class MyHashable(ABC):
@classmethod
def __subclasshook__(cls, sbcls):
hash_func = getattr(sbcls, "__hash__", None)
return hash_func is not None