google / ci_edit

A terminal text editor with mouse support and ctrl+Q to quit.
Apache License 2.0
223 stars 54 forks source link

Correct improper 'assert' statements #179

Closed cclauss closed 5 years ago

cclauss commented 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.