Skip to content

complex-valued comparison incorrectly succeeds #17361

Closed
@nschloe

Description

@nschloe

Since there is no ordering in the complex numbers, vanilla Python correctly rejects something like

0 < 1 + 1j

with

TypeError: '<' not supported between instances of 'int' and 'complex'

Numpy incorrectly does something -- no idea what though. In any case, the following should probably fail:

import numpy

z = 1 + 1j
0 < numpy.array(z)  # succeeds?!

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