Skip to content

numpy float multiplied by a string does not raise a TypeError #5919

@ngoldbaum

Description

@ngoldbaum

This illustrates the issue:

>>> import numpy as np 
>>> print 'x'*np.float64(3.5)

The same construction using a regular python float raises a TypeError, as I would expect:

>>> 'x'*3.5
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't multiply sequence by non-int of type 'float'

I haven't looked very closely at the implementation of the numpy float class. Please feel free to close this issue if this is working as expected.

This is on numpy 1.9.2 and python 2.7.9

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