doc: Fix assert statement in Lightning Tour

Python 3 throws an error message on the original assert statement. Also, according to the Python documentation regarding the assert statement (https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement), `assert` takes at least one argument and at most two. In the two-argument form the second argument is meant as an error message to be displayed when the assertion fails. I don't think this is intended in this case.
This commit is contained in:
mpuels 2017-12-06 16:40:51 +01:00 committed by GitHub
parent 798c4c14a7
commit 82e575ebfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -188,7 +188,10 @@ p
pasta = doc[6] pasta = doc[6]
hippo = doc[8] hippo = doc[8]
assert apple.similarity(banana) > pasta.similarity(hippo) assert apple.similarity(banana) > pasta.similarity(hippo)
assert apple.has_vector, banana.has_vector, pasta.has_vector, hippo.has_vector assert apple.has_vector
assert banana.has_vector
assert pasta.has_vector
assert hippo.has_vector
p p
| For the best results, you should run this example using the | For the best results, you should run this example using the