[Tutor] isinstance versus 'is'?

Alex Hall ahall at autodist.com
Tue Jul 5 15:05:45 EDT 2016


Hi all,
Thanks for all the help regarding decorators. It makes more sense now.

I was double checking that I remembered the isinstance order of arguments
correctly by using the command line interpreter, and found something very
odd.

>>> a = 5
>>> isinstance(a, int)
True
>>> a is int
False

What happened there? Don't these do the same thing? I thought I could use
them interchangeably?

-- 
Alex Hall
Automatic Distributors, IT department
ahall at autodist.com


More information about the Tutor mailing list