Skip to content

Commit

Permalink
Added comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
rchateauneu committed May 20, 2021
1 parent 282a8b7 commit 42c90d9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rdflib/term.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ def __hash__(self):
"""
# don't use super()... for efficiency reasons, see Identifier.__hash__
res = str.__hash__(self)
# Directly accessing the member is faster than the property.
if self._language:
res ^= hash(self._language.lower())
if self._datatype:
Expand Down Expand Up @@ -1015,6 +1016,7 @@ def __eq__(self, other):
return True
if other is None:
return False
# Directly accessing the member is faster than the property.
if isinstance(other, Literal):
return (
self._datatype == other._datatype
Expand Down

0 comments on commit 42c90d9

Please sign in to comment.