Python types.XRangeType() Examples

The following are 2 code examples of types.XRangeType(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module types , or try the search function .
Example #1
Source File: __init__.py    From canape with GNU General Public License v3.0 5 votes vote down vote up
def newframe(data=None, encoding="binary"):
    """Create a new data frame from existing data
    :param data: The data, can be a byte array, string, dictionary or None for an empty frame
    """
    if data is None:
        return CANAPE.DataFrames.DataFrame()
    elif (type(data) is list) or (type(data) is types.GeneratorType) or (type(data) is types.XRangeType):
        return CANAPE.DataFrames.DataFrame(CANAPE.Utils.ConsoleUtils.ConvertListToByteArray(data)) 
    elif type(data) is str:
        return CANAPE.DataFrames.DataFrame(data, encoding)
    else:
        return CANAPE.DataFrames.DataFrame(data) 
Example #2
Source File: jsonobject.py    From zstack-utility with Apache License 2.0 5 votes vote down vote up
def _is_unsupported_type(obj):
    return isinstance(obj, (types.ComplexType, types.TupleType, types.FunctionType, types.LambdaType,
                           types.GeneratorType, types.MethodType, types.UnboundMethodType, types.BuiltinFunctionType, types.BuiltinMethodType, types.FileType,
                           types.XRangeType, types.TracebackType, types.FrameType, types.DictProxyType, types.NotImplementedType, types.GetSetDescriptorType,
                           types.MemberDescriptorType))