Skip to content

Commit ba56957

Browse files
committed
Rename association-related classes to relationship aswell for improved clarity
1 parent aa46267 commit ba56957

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

pylint/pyreverse/inspector.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,35 +299,35 @@ def _imported_module(
299299
mod_paths.append(mod_path)
300300

301301

302-
class AssociationHandlerInterface(ABC):
302+
class RelationshipHandlerInterface(ABC):
303303
@abstractmethod
304304
def set_next(
305-
self, handler: AssociationHandlerInterface
306-
) -> AssociationHandlerInterface:
305+
self, handler: RelationshipHandlerInterface
306+
) -> RelationshipHandlerInterface:
307307
pass
308308

309309
@abstractmethod
310310
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
311311
pass
312312

313313

314-
class AbstractAssociationHandler(AssociationHandlerInterface):
314+
class AbstractRelationshipHandler(RelationshipHandlerInterface):
315315
"""
316-
Chain of Responsibility for handling types of association, useful
317-
to expand in the future if we want to add more distinct associations.
316+
Chain of Responsibility for handling types of relationships, useful
317+
to expand in the future if we want to add more distinct relationships.
318318
319-
Every link of the chain checks if it's a certain type of association.
320-
If no association is found it's set as a generic association in `associations_type`.
319+
Every link of the chain checks if it's a certain type of relationship.
320+
If no relationship is found it's set as a generic relationship in `relationships_type`.
321321
322322
The default chaining behavior is implemented inside the base handler
323323
class.
324324
"""
325325

326-
_next_handler: AssociationHandlerInterface
326+
_next_handler: RelationshipHandlerInterface
327327

328328
def set_next(
329-
self, handler: AssociationHandlerInterface
330-
) -> AssociationHandlerInterface:
329+
self, handler: RelationshipHandlerInterface
330+
) -> RelationshipHandlerInterface:
331331
self._next_handler = handler
332332
return handler
333333

@@ -337,7 +337,7 @@ def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
337337
self._next_handler.handle(node, parent)
338338

339339

340-
class CompositionsHandler(AbstractAssociationHandler):
340+
class CompositionsHandler(AbstractRelationshipHandler):
341341
"""Handle composition relationships where parent creates child objects."""
342342

343343
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
@@ -384,7 +384,7 @@ def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
384384
super().handle(node, parent)
385385

386386

387-
class AggregationsHandler(AbstractAssociationHandler):
387+
class AggregationsHandler(AbstractRelationshipHandler):
388388
"""Handle aggregation relationships where parent receives child objects."""
389389

390390
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
@@ -431,7 +431,7 @@ def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
431431
super().handle(node, parent)
432432

433433

434-
class AssociationsHandler(AbstractAssociationHandler):
434+
class AssociationsHandler(AbstractRelationshipHandler):
435435
"""Handle regular association relationships."""
436436

437437
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:

0 commit comments

Comments
 (0)