Skip to content

Bug? numpy.dtype is not sortable. #1106

Closed
@tkf

Description

@tkf

I find this when I am writing the pull request #1098. As it is loosely related to the pull request, I am reporting here as a separate issue.

It looks like dtype does not support sorting:

>>> from numpy import dtype
>>> sorted([dtype('bool'), dtype('float64'), dtype('complex64'),
...         dtype('float64'), dtype('object')])
[dtype('bool'),
 dtype('float64'),
 dtype('complex64'),
 dtype('float64'),
 dtype('object')]

core.internals._consolidate relies sortability of dtype. Probably it is better to sort using dtype.name as I did in bae8155?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions