Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created July 6, 2023 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephengruppetta/1e3d43c4ff5912de6facf571bb4449f1 to your computer and use it in GitHub Desktop.
Save stephengruppetta/1e3d43c4ff5912de6facf571bb4449f1 to your computer and use it in GitHub Desktop.
import collections
# Dictionary
print(isinstance({"Jim": 10, "Chris": 12}, collections.abc.Collection))
# True
# Tuple
print(isinstance((2, 4, 6), collections.abc.Collection))
# True
# range object
print(isinstance(range(5, 10), collections.abc.Collection))
# True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment