Created
January 8, 2015 14:38
-
-
Save rectalogic/2e7f0a7aea60ea816c36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from abc import ABCMeta | |
class ListLike: | |
__metaclass__ = ABCMeta | |
ListLike.register(list) | |
ListLike.register(tuple) | |
ListLike.register(_FieldSequence) | |
>>> isinstance([], ListLike) | |
True | |
>>> isinstance(tuple(), ListLike) | |
True | |
>>> isinstance("", ListLike) | |
False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment