Skip to content

Commit

Permalink
remove incorrect check in container for rdf:List that prevents duplic…
Browse files Browse the repository at this point in the history
…ate elements
  • Loading branch information
William Waites committed Jan 19, 2017
1 parent 3212120 commit a972e7b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 0 additions & 3 deletions rdflib/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ def __len__(self):
count = 0
links = set()
for item in self.graph.items(self.uri):
assert item not in links, \
"There is a loop in the RDF list! " + \
"(%s has been processed before)" % item
links.add(item)
count += 1
return count
Expand Down
1 change: 1 addition & 0 deletions test/test_issue223.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_collection_with_duplicates():
for _,_,o in g.triples((URIRef("http://example.org/s"), URIRef("http://example.org/p"), None)):
break
c = list(Collection(g, o))
assert c == list(URIRef("http://example.org/" + x) for x in ["a", "b", "a"])

if __name__ == '__main__':
test_collection_with_duplicates()

0 comments on commit a972e7b

Please sign in to comment.