Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix pylab mypy #29264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/matplotlib/pylab.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,24 @@
from matplotlib.pyplot import *

from numpy import *
del fft # remove imported module numpy.fft to prevent implicit re-def

Check failure on line 48 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 F821 undefined name 'fft' Raw Output: ./lib/matplotlib/pylab.py:48:5: F821 undefined name 'fft'
del random # remove imported module numpy.random to prevent implicit re-def

Check failure on line 49 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 F821 undefined name 'random' Raw Output: ./lib/matplotlib/pylab.py:49:5: F821 undefined name 'random'
from numpy.fft import *

Check failure on line 50 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "fft" already defined (by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:50: error: Name "fft" already defined (by an import) [no-redef]

Check failure on line 50 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:50:1: E402 module level import not at top of file
from numpy.random import *

Check failure on line 51 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "random" already defined (by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:51: error: Name "random" already defined (by an import) [no-redef]

Check failure on line 51 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Incompatible import of "power" (imported name has type overloaded function, local name has type "_UFunc_Nin2_Nout1[Literal['power'], Literal[18], None]") [assignment] Raw Output: lib/matplotlib/pylab.py:51: error: Incompatible import of "power" (imported name has type overloaded function, local name has type "_UFunc_Nin2_Nout1[Literal['power'], Literal[18], None]") [assignment]

Check failure on line 51 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:51:1: E402 module level import not at top of file
from numpy.linalg import *

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "outer" already defined (possibly by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:52: error: Name "outer" already defined (possibly by an import) [no-redef]

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "trace" already defined (possibly by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:52: error: Name "trace" already defined (possibly by an import) [no-redef]

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "diagonal" already defined (possibly by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:52: error: Name "diagonal" already defined (possibly by an import) [no-redef]

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Name "cross" already defined (possibly by an import) [no-redef] Raw Output: lib/matplotlib/pylab.py:52: error: Name "cross" already defined (possibly by an import) [no-redef]

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Incompatible import of "matmul" (imported name has type overloaded function, local name has type "_GUFunc_Nin2_Nout1[Literal['matmul'], Literal[19], None, Literal['(n?,k),(k,m?)->(n?,m?)']]") [assignment] Raw Output: lib/matplotlib/pylab.py:52: error: Incompatible import of "matmul" (imported name has type overloaded function, local name has type "_GUFunc_Nin2_Nout1[Literal['matmul'], Literal[19], None, Literal['(n?,k),(k,m?)->(n?,m?)']]") [assignment]

Check failure on line 52 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:52:1: E402 module level import not at top of file

import numpy as np

Check failure on line 54 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:54:1: E402 module level import not at top of file
import numpy.ma as ma

Check failure on line 55 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:55:1: E402 module level import not at top of file

# don't let numpy's datetime hide stdlib
import datetime

Check failure on line 58 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] reported by reviewdog 🐶 E402 module level import not at top of file Raw Output: ./lib/matplotlib/pylab.py:58:1: E402 module level import not at top of file

# This is needed, or bytes will be numpy.random.bytes from
# "from numpy.random import *" above
bytes = __import__("builtins").bytes
# We also don't want the numpy version of these functions
abs = __import__("builtins").abs
bool = __import__("builtins").bool

Check failure on line 65 in lib/matplotlib/pylab.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] reported by reviewdog 🐶 Cannot assign to a type [misc] Raw Output: lib/matplotlib/pylab.py:65: error: Cannot assign to a type [misc]
max = __import__("builtins").max
min = __import__("builtins").min
pow = __import__("builtins").pow
Expand Down
Loading