Skip to content

Instantly share code, notes, and snippets.

@amyreese
Created November 19, 2014 22:52
Show Gist options
  • Save amyreese/67f0c47922436ab4b0cf to your computer and use it in GitHub Desktop.
Save amyreese/67f0c47922436ab4b0cf to your computer and use it in GitHub Desktop.
Python 2.7.8 (default, Oct 16 2014, 11:03:30)
Type "copyright", "credits" or "license" for more information.
IPython 2.2.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import collections, numbers
In [2]: isinstance(1, numbers.Number)
Out[2]: True
In [3]: isinstance(1L, numbers.Number)
Out[3]: True
In [4]: isinstance(True, numbers.Number)
Out[4]: True
In [5]: isinstance(set(), collections.Container)
Out[5]: True
In [6]: isinstance(list(), collections.Container)
Out[6]: True
In [7]: isinstance("hello", collections.Container)
Out[7]: True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment