Skip to content

Instantly share code, notes, and snippets.

@axil
Created April 16, 2022 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axil/dad739d1022c1f76a6fdb18d425c3a62 to your computer and use it in GitHub Desktop.
Save axil/dad739d1022c1f76a6fdb18d425c3a62 to your computer and use it in GitHub Desktop.
subclass_list
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