mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-08 04:58:29 +03:00
This is E721 in pycodestyle [1]: "do not compare types, use ‘isinstance()’" The main differece between "type() is" and "isinstance()" is that isinstance() supports inheritance. [1] This can be seen in the example below: >>> type(True) is int False >>> isinstance(True, int) True As we can see in python 'bool' a subclass of 'int'. [1] https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes [2] https://docs.python.org/2/library/functions.html#isinstance