Skip to content

Instantly share code, notes, and snippets.

@MSeifert04
Created April 23, 2017 01:06
Show Gist options
  • Save MSeifert04/e39d91f9d262618a32f7db14aaab15f4 to your computer and use it in GitHub Desktop.
Save MSeifert04/e39d91f9d262618a32f7db14aaab15f4 to your computer and use it in GitHub Desktop.
%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