Thanks to visit codestin.com
Credit goes to github.com

Skip to content

dataclass is not Hashable #11463

Description

@KotlinIsland
from dataclasses import dataclass
from typing import Hashable


@dataclass
class SusDataclass:
    b = "AMONGUS"


h: Hashable = SusDataclass()  # SUS ALERT!

d = {
    SusDataclass(): 1  # SUS ALERT! fails at runtime
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions