internal static bool IsSequence(PyType objectType) { //must implement iterable protocol to fully implement sequence protocol if (!IterableDecoder.IsIterable(objectType)) { return(false); } //returns wheter it implements the sequence protocol //according to python doc this needs to exclude dict subclasses //but I don't know how to look for that given the objectType //rather than the instance. return(objectType.HasAttr("__getitem__")); }
internal static bool IsIterable(PyType objectType) { return(objectType.HasAttr("__iter__")); }