Skip to content

Behaviour of np.generic.real and np.generic.imag is ... really imaginative  #10818

@eric-wieser

Description

@eric-wieser

Discovered in numpy/numpy-stubs#14 (comment)

>>> b = np.bytes_(b'test')
>>> b.real, b.imag
('test', '')

>>> d = np.datetime64(dt.datetime.now())
>>> d.real, d.imag
(numpy.datetime64('2018-03-26T15:22:14.672804'), numpy.datetime64('1970-01-01T00:00:00.000000'))

It seems like we should give an error or warning here, in both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triagedIssue/PR that was discussed in a triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions