Closed cclauss closed 5 years ago
From: https://docs.python.org/3/reference/simple_stmts.html?#the-assert-statement assert statements in Python are equivalent to:
Which means that assert type(string), unicode is equivalent to:
The assertions will always pass because even bool(type(None)) is True.
Also, Python best practice is to avoid directly comparing types but to use isinstance() instead.
From: https://docs.python.org/3/reference/simple_stmts.html?#the-assert-statement assert statements in Python are equivalent to:
Which means that assert type(string), unicode is equivalent to:
The assertions will always pass because even bool(type(None)) is True.
Also, Python best practice is to avoid directly comparing types but to use isinstance() instead.