def dtype2trait ( dtype ):
    """ Get the corresponding trait for a numpy dtype.
    """

    import numpy

    if numpy.typecodes['Float'] in dtype.char:
        return TFloat

    elif dtype.char in numpy.typecodes['AllInteger']:
        return TInt

    elif dtype.char[0] == 'S':
        return Str

    else:
        return Any

#-------------------------------------------------------------------------------
#  'AbstractArray' trait base class:
#-------------------------------------------------------------------------------
dataset/ETHPy150Open enthought/traits/traits/trait_numeric.py/dtype2trait/swapped operands of `in`