mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	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:
		
							parent
							
								
									798c4c14a7
								
							
						
					
					
						commit
						82e575ebfb
					
				| 
						 | 
				
			
			@ -188,7 +188,10 @@ p
 | 
			
		|||
    pasta = doc[6]
 | 
			
		||||
    hippo = doc[8]
 | 
			
		||||
    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
 | 
			
		||||
    |  For the best results, you should run this example using the
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user