8000 reload(numpy);numpy.max([]) raises TypeError · Issue #7844 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
reload(numpy);numpy.max([]) raises TypeError #7844
Closed
@cgohlke

Description

@cgohlke

Using maintenance/1.11.x on Windows (msvc builds), the following code fails:

Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib import reload
>>> import numpy
>>> reload(numpy)
<module 'numpy' from 'X:\\Python35\\lib\\site-packages\\numpy\\__init__.py'>
>>> numpy.max([])
Traceback (most recent call last):
  File "X:\Python35\lib\site-packages\numpy\core\fromnumeric.py", line 2290, in amax
    amax = a.max
AttributeError: 'list' object has no attribute 'max'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "X:\Python35\lib\site-packages\numpy\core\fromnumeric.py", line 2293, in amax
    out=out, **kwargs)
  File "X:\Python35\lib\site-packages\numpy\core\_methods.py", line 26, in _amax
    return umr_maximum(a, axis, None, out, keepdims)
TypeError: an integer is required (got type type)

I traced this to #7736, backport of #4619

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0