Type checking or Object type comparisons
Published: Wednesday, Dec 26, 2007 Last modified: Thursday, Nov 14, 2024
http://www.python.org/peps/pep-0008.html No: if type(obj) is type(1): Yes: if isinstance(obj, int):
http://www.python.org/peps/pep-0008.html No: if type(obj) is type(1): Yes: if isinstance(obj, int):