Created
April 23, 2017 01:06
-
-
Save MSeifert04/e39d91f9d262618a32f7db14aaab15f4 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
%load_ext cython | |
%%cython | |
from cpython.sequence cimport PySequence_Check | |
def is_sequence(val): | |
return PySequence_Check(val) | |
class A(object): | |
def __getitem__(self, item): | |
return 1 | |
is_sequence(A()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment