Exemple #1
0
        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__"));
        }
Exemple #2
0
 internal static bool IsIterable(PyType objectType)
 {
     return(objectType.HasAttr("__iter__"));
 }