summaryrefslogtreecommitdiff
path: root/astroid/brain
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2023-01-09 13:05:51 +0100
committerGitHub <noreply@github.com>2023-01-09 12:05:51 +0000
commite355324cefe0fa4ae7f4cd6c240fabf0bef94c1c (patch)
tree73f70e1624d052139f644a13ed87436bafa1573a /astroid/brain
parente259af237ed140e7c15ad61483e92302b3e8ce14 (diff)
downloadastroid-git-e355324cefe0fa4ae7f4cd6c240fabf0bef94c1c.tar.gz
Some modifications for pep237 with pydocstringformatter (#1792)
Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'astroid/brain')
-rw-r--r--astroid/brain/brain_boto3.py3
-rw-r--r--astroid/brain/brain_collections.py4
-rw-r--r--astroid/brain/brain_ctypes.py4
-rw-r--r--astroid/brain/brain_numpy_core_einsumfunc.py2
-rw-r--r--astroid/brain/brain_numpy_utils.py5
-rw-r--r--astroid/brain/brain_unittest.py10
6 files changed, 17 insertions, 11 deletions
diff --git a/astroid/brain/brain_boto3.py b/astroid/brain/brain_boto3.py
index d9698b8a..425a1d33 100644
--- a/astroid/brain/brain_boto3.py
+++ b/astroid/brain/brain_boto3.py
@@ -2,7 +2,8 @@
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
-"""Astroid hooks for understanding boto3.ServiceRequest()."""
+"""Astroid hooks for understanding ``boto3.ServiceRequest()``."""
+
from astroid import extract_node
from astroid.manager import AstroidManager
from astroid.nodes.scoped_nodes import ClassDef
diff --git a/astroid/brain/brain_collections.py b/astroid/brain/brain_collections.py
index 123096a2..51014dfa 100644
--- a/astroid/brain/brain_collections.py
+++ b/astroid/brain/brain_collections.py
@@ -86,8 +86,8 @@ register_module_extender(AstroidManager(), "collections", _collections_transform
def _looks_like_subscriptable(node: ClassDef) -> bool:
"""
- Returns True if the node corresponds to a ClassDef of the Collections.abc module that
- supports subscripting
+ Returns True if the node corresponds to a ClassDef of the Collections.abc module
+ that supports subscripting.
:param node: ClassDef node
"""
diff --git a/astroid/brain/brain_ctypes.py b/astroid/brain/brain_ctypes.py
index 323b19cc..35cb208f 100644
--- a/astroid/brain/brain_ctypes.py
+++ b/astroid/brain/brain_ctypes.py
@@ -19,7 +19,9 @@ from astroid.manager import AstroidManager
def enrich_ctypes_redefined_types():
"""
- For each ctypes redefined types, overload 'value' and '_type_' members definition.
+ For each ctypes redefined types, overload 'value' and '_type_' members
+ definition.
+
Overloading 'value' is mandatory otherwise astroid cannot infer the correct type for it.
Overloading '_type_' is necessary because the class definition made here replaces the original
one, in which '_type_' member is defined. Luckily those original class definitions are very short
diff --git a/astroid/brain/brain_numpy_core_einsumfunc.py b/astroid/brain/brain_numpy_core_einsumfunc.py
index 0f4789c6..d76241e4 100644
--- a/astroid/brain/brain_numpy_core_einsumfunc.py
+++ b/astroid/brain/brain_numpy_core_einsumfunc.py
@@ -4,7 +4,7 @@
"""
Astroid hooks for numpy.core.einsumfunc module:
-https://github.com/numpy/numpy/blob/main/numpy/core/einsumfunc.py
+https://github.com/numpy/numpy/blob/main/numpy/core/einsumfunc.py.
"""
from astroid import nodes
diff --git a/astroid/brain/brain_numpy_utils.py b/astroid/brain/brain_numpy_utils.py
index b9e5d5f3..a3dbb116 100644
--- a/astroid/brain/brain_numpy_utils.py
+++ b/astroid/brain/brain_numpy_utils.py
@@ -22,8 +22,9 @@ def numpy_supports_type_hints() -> bool:
def _get_numpy_version() -> tuple[str, str, str]:
"""
- Return the numpy version number if numpy can be imported. Otherwise returns
- ('0', '0', '0')
+ Return the numpy version number if numpy can be imported.
+
+ Otherwise returns ('0', '0', '0')
"""
try:
import numpy # pylint: disable=import-outside-toplevel
diff --git a/astroid/brain/brain_unittest.py b/astroid/brain/brain_unittest.py
index b34e1cf5..89f5d26f 100644
--- a/astroid/brain/brain_unittest.py
+++ b/astroid/brain/brain_unittest.py
@@ -2,7 +2,7 @@
# For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/astroid/blob/main/CONTRIBUTORS.txt
-"""Astroid hooks for unittest module"""
+"""Astroid hooks for unittest module."""
from astroid.brain.helpers import register_module_extender
from astroid.builder import parse
from astroid.const import PY38_PLUS
@@ -11,9 +11,11 @@ from astroid.manager import AstroidManager
def IsolatedAsyncioTestCaseImport():
"""
- In the unittest package, the IsolatedAsyncioTestCase class is imported lazily, i.e only
- when the __getattr__ method of the unittest module is called with 'IsolatedAsyncioTestCase' as
- argument. Thus the IsolatedAsyncioTestCase is not imported statically (during import time).
+ In the unittest package, the IsolatedAsyncioTestCase class is imported lazily.
+
+ I.E. only when the ``__getattr__`` method of the unittest module is called with
+ 'IsolatedAsyncioTestCase' as argument. Thus the IsolatedAsyncioTestCase
+ is not imported statically (during import time).
This function mocks a classical static import of the IsolatedAsyncioTestCase.
(see https://github.com/PyCQA/pylint/issues/4060)