module documentation

Different utilities for the numpy brains.

Function infer_numpy_member Undocumented
Function looks_like_numpy_member Returns True if the node is a member of numpy whose name is member_name.
Function numpy_supports_type_hints Returns True if numpy supports type hints.
Constant NUMPY_VERSION_TYPE_HINTS_SUPPORT Undocumented
Function _get_numpy_version Return the numpy version number if numpy can be imported.
Function _is_a_numpy_module Returns True if the node is a representation of a numpy module.
def infer_numpy_member(src, node, context: InferenceContext|None = None): (source)

Undocumented

def looks_like_numpy_member(member_name: str, node: NodeNG) -> bool: (source)

Returns True if the node is a member of numpy whose name is member_name. :param member_name: name of the member :param node: node to test :return: True if the node is a member of numpy

def numpy_supports_type_hints() -> bool: (source)

Returns True if numpy supports type hints.

NUMPY_VERSION_TYPE_HINTS_SUPPORT: tuple[str, ...] = (source)

Undocumented

Value
('1', '20', '0')
def _get_numpy_version() -> tuple[str, str, str]: (source)

Return the numpy version number if numpy can be imported. Otherwise returns ('0', '0', '0')

def _is_a_numpy_module(node: Name) -> bool: (source)

Returns True if the node is a representation of a numpy module. For example in : import numpy as np x = np.linspace(1, 2) The node <Name.np> is a representation of the numpy module. :param node: node to test :return: True if the node is a representation of the numpy module.