From 2c60d0cb1edacb02543e52e8854a7efd75fcb20f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 16 Jan 2017 13:27:26 +0100 Subject: [PATCH] Test #743: Tokens unhashable. --- spacy/tests/regression/test_issue743.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 spacy/tests/regression/test_issue743.py diff --git a/spacy/tests/regression/test_issue743.py b/spacy/tests/regression/test_issue743.py new file mode 100644 index 000000000..e4a766fa5 --- /dev/null +++ b/spacy/tests/regression/test_issue743.py @@ -0,0 +1,11 @@ +from __future__ import unicode_literals +from ...vocab import Vocab +from ...tokens.doc import Doc + + +def test_token_is_hashable(): + doc = Doc(Vocab(), ['hello', 'world']) + token = doc[0] + s = set([token]) + items = list(s) + assert items[0] is token