Luuk <luuk.vosslam...@gmail.com> writes: ... > Maybe i should have asked this: > > What is the difference between 'type(5)==int' and 'isinstance(5,int)' > > and, if there is no difference why did someone invent 'isinstance()' ...
Look: Python 3.6.6 (default, Aug 13 2018, 18:24:23) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> isinstance(True, int) True >>> type(True) == int False >>> type(True) <class 'bool'> -- Alan Bawden -- https://mail.python.org/mailman/listinfo/python-list