RDFLib / rdflib

RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
https://rdflib.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.14k stars 555 forks source link

remove __hash__ from mutable classes such as Graph #719

Open joernhees opened 7 years ago

joernhees commented 7 years ago

see discussion in #718 : IOMemory by default uses hash(graph) to hash its identifier to then create hashed quads... all of this happens in light of "hashing a graph" meaning that its triples are hashed in a cryptographically reliable way...

maybe we should just not define __hash__ for mutable things such as Graph...

jpmccu commented 7 years ago

We could make an immutable graph class that fixes that. Maybe IsomorphicGraph would also be immutable.