Skip to content

Instantly share code, notes, and snippets.

@stephengruppetta
Created July 6, 2023 11:47
Show Gist options
  • Save stephengruppetta/dcc5364faf321b86605294883c51191e to your computer and use it in GitHub Desktop.
Save stephengruppetta/dcc5364faf321b86605294883c51191e to your computer and use it in GitHub Desktop.
import collections
team_members = ["Jim", "Chris", "Jess", "Zahra"]
# A list is a sequence
print(isinstance(team_members, collections.abc.Sequence))
# True
# It's not a mapping
print(isinstance(team_members, collections.abc.Mapping))
# False
# And it's not a set, either
print(isinstance(team_members, collections.abc.Set))
# False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment