Test #743: Tokens unhashable.

This commit is contained in:
Matthew Honnibal 2017-01-16 13:27:26 +01:00
parent 48c712f1c1
commit 2c60d0cb1e
1 changed files with 11 additions and 0 deletions

View File

@ -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