summaryrefslogtreecommitdiff
path: root/astroid/brain/brain_numpy.py
diff options
context:
space:
mode:
authorhippo91 <guillaume.peillex@gmail.com>2019-02-26 15:26:20 +0100
committerhippo91 <guillaume.peillex@gmail.com>2019-02-26 15:26:20 +0100
commit919f938df5ac1eb1e4f95322a585f1ff1cc72c3c (patch)
tree51f06ba3871f134b48baf33d68bda9c11e13021e /astroid/brain/brain_numpy.py
parentb0ad5a1c36354104d7d34627bc985f773fd89122 (diff)
downloadastroid-git-919f938df5ac1eb1e4f95322a585f1ff1cc72c3c.tar.gz
Removing declaration of zeros_like (pass). Filtering tuple and list from types inferred by call to full_like and ones_like
Diffstat (limited to 'astroid/brain/brain_numpy.py')
-rw-r--r--astroid/brain/brain_numpy.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/astroid/brain/brain_numpy.py b/astroid/brain/brain_numpy.py
index 1d0e42f9..919c9607 100644
--- a/astroid/brain/brain_numpy.py
+++ b/astroid/brain/brain_numpy.py
@@ -44,7 +44,6 @@ def numpy_random_mtrand_transform():
def power(a, size=None): return any
def rand(*args): return any
def randint(low, high=None, size=None, dtype='l'): pass
- def zeros_like(a, dtype=None, order='K', subok=True): pass
def randn(*args): return any
def random_integers(low, high=None, size=None): return any
def random_sample(size=None): return any
@@ -552,6 +551,18 @@ astroid.MANAGER.register_transform(
functools.partial(_looks_like_numpy_function, "zeros_like", "numpy.core.numeric"),
)
+astroid.MANAGER.register_transform(
+ astroid.FunctionDef,
+ _replace_numpy_function_infer_call_result,
+ functools.partial(_looks_like_numpy_function, "full_like", "numpy.core.numeric"),
+)
+
+astroid.MANAGER.register_transform(
+ astroid.FunctionDef,
+ _replace_numpy_function_infer_call_result,
+ functools.partial(_looks_like_numpy_function, "ones_like", "numpy.core.numeric"),
+)
+
astroid.register_module_extender(
astroid.MANAGER, "numpy.core.umath", numpy_core_umath_transform
)