diff options
Diffstat (limited to 'astroid/interpreter')
-rw-r--r-- | astroid/interpreter/_import/spec.py | 4 | ||||
-rw-r--r-- | astroid/interpreter/dunder_lookup.py | 2 | ||||
-rw-r--r-- | astroid/interpreter/objectmodel.py | 12 |
3 files changed, 10 insertions, 8 deletions
diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 05fec7ef..ecf330b0 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -44,7 +44,7 @@ class ModuleType(enum.Enum): class ModuleSpec(NamedTuple): - """Defines a class similar to PEP 420's ModuleSpec + """Defines a class similar to PEP 420's ModuleSpec. A module spec defines a name of a module, its type, location and where submodules can be found, if the module is a package. @@ -71,7 +71,7 @@ class Finder: processed: list[str], submodule_path: Sequence[str] | None, ) -> ModuleSpec | None: - """Find the given module + """Find the given module. Each finder is responsible for each protocol of finding, as long as they all return a ModuleSpec. diff --git a/astroid/interpreter/dunder_lookup.py b/astroid/interpreter/dunder_lookup.py index 8ec0e9fc..272d27ec 100644 --- a/astroid/interpreter/dunder_lookup.py +++ b/astroid/interpreter/dunder_lookup.py @@ -32,7 +32,7 @@ def _lookup_in_mro(node, name) -> list: def lookup(node, name) -> list: - """Lookup the given special method name in the given *node* + """Lookup the given special method name in the given *node*. If the special method was found, then a list of attributes will be returned. Otherwise, `astroid.AttributeInferenceError` diff --git a/astroid/interpreter/objectmodel.py b/astroid/interpreter/objectmodel.py index 5a12ef8d..491358aa 100644 --- a/astroid/interpreter/objectmodel.py +++ b/astroid/interpreter/objectmodel.py @@ -125,7 +125,7 @@ class ObjectModel: return [o[LEN_OF_IMPL_PREFIX:] for o in dir(self) if o.startswith(IMPL_PREFIX)] def lookup(self, name): - """Look up the given *name* in the current model + """Look up the given *name* in the current model. It should return an AST or an interpreter object, but if the name is not found, then an AttributeInferenceError will be raised. @@ -333,7 +333,9 @@ class FunctionModel(ObjectModel): func = self._instance class DescriptorBoundMethod(bases.BoundMethod): - """Bound method which knows how to understand calling descriptor binding.""" + """Bound method which knows how to understand calling descriptor + binding. + """ def implicit_parameters(self) -> Literal[0]: # Different than BoundMethod since the signature @@ -390,7 +392,7 @@ class FunctionModel(ObjectModel): @property def args(self): - """Overwrite the underlying args to match those of the underlying func + """Overwrite the underlying args to match those of the underlying func. Usually the underlying *func* is a function/method, as in: @@ -514,7 +516,7 @@ class ClassModel(ObjectModel): @property def attr___subclasses__(self): - """Get the subclasses of the underlying class + """Get the subclasses of the underlying class. This looks only in the current module for retrieving the subclasses, thus it might miss a couple of them. @@ -841,7 +843,7 @@ class DictModel(ObjectModel): class PropertyModel(ObjectModel): - """Model for a builtin property""" + """Model for a builtin property.""" def _init_function(self, name): function = nodes.FunctionDef(name=name, parent=self._instance) |