From be003599a9a7ae94a8f09a80ac9e0683cd133c20 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Wed, 2 Oct 2024 11:20:50 -0400 Subject: [PATCH] Remove unused numpy utility functions (#2595) Follow-up to c7ea1e941b4b88ec. --- ChangeLog | 3 +++ astroid/brain/brain_numpy_utils.py | 28 ---------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52d8309031..f607d78f79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ What's New in astroid 4.0.0? ============================ Release date: TBA +* Removed internal functions ``infer_numpy_member``, ``name_looks_like_numpy_member``, and + ``attribute_looks_like_numpy_member`` from ``astroid.brain.brain_numpy_utils``. + * Fix crashes with large positive and negative list multipliers. Closes #2521 diff --git a/astroid/brain/brain_numpy_utils.py b/astroid/brain/brain_numpy_utils.py index 8ce7144372..a3d4ed5324 100644 --- a/astroid/brain/brain_numpy_utils.py +++ b/astroid/brain/brain_numpy_utils.py @@ -48,12 +48,6 @@ def infer_numpy_attribute( return extracted_node.infer(context=context) -# TODO: Deprecate and remove this function -def infer_numpy_member(src, node, context: InferenceContext | None = None): - node = extract_node(src) - return node.infer(context=context) - - def _is_a_numpy_module(node: Name) -> bool: """ Returns True if the node is a representation of a numpy module. @@ -96,25 +90,3 @@ def attribute_name_looks_like_numpy_member( and isinstance(node.expr, Name) and _is_a_numpy_module(node.expr) ) - - -# TODO: Deprecate and remove this function -def name_looks_like_numpy_member(member_name: str, node: Name) -> bool: - """ - Returns True if the Name is a member of numpy whose - name is member_name. - """ - return node.name == member_name and node.root().name.startswith("numpy") - - -# TODO: Deprecate and remove this function -def attribute_looks_like_numpy_member(member_name: str, node: Attribute) -> bool: - """ - Returns True if the Attribute is a member of numpy whose - name is member_name. - """ - return ( - node.attrname == member_name - and isinstance(node.expr, Name) - and _is_a_numpy_module(node.expr) - )