Created
April 16, 2022 19:19
-
-
Save axil/dad739d1022c1f76a6fdb18d425c3a62 to your computer and use it in GitHub Desktop.
subclass_list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point(list): | |
def __init__(self, x, y): | |
super().__init__((x, y)) | |
>>> points = [Point(1,2), Point(2,3), Point(1,2)] | |
>>> Counter(points) | |
TypeError: unhashable type: 'Point' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment