Skip to content

Commit 5852435

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

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
@@ -300,35 +300,35 @@ def _imported_module(
300300
mod_paths.append(mod_path)
301301

302302

303-
class AssociationHandlerInterface(ABC):
303+
class RelationshipHandlerInterface(ABC):
304304
@abstractmethod
305305
def set_next(
306-
self, handler: AssociationHandlerInterface
307-
) -> AssociationHandlerInterface:
306+
self, handler: RelationshipHandlerInterface
307+
) -> RelationshipHandlerInterface:
308308
pass
309309

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

314314

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

327-
_next_handler: AssociationHandlerInterface
327+
_next_handler: RelationshipHandlerInterface
328328

329329
def set_next(
330-
self, handler: AssociationHandlerInterface
331-
) -> AssociationHandlerInterface:
330+
self, handler: RelationshipHandlerInterface
331+
) -> RelationshipHandlerInterface:
332332
self._next_handler = handler
333333
return handler
334334

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

340340

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

344344
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
@@ -385,7 +385,7 @@ def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
385385
super().handle(node, parent)
386386

387387

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

391391
def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
@@ -432,7 +432,7 @@ def handle(self, node: nodes.AssignAttr, parent: nodes.ClassDef) -> None:
432432
super().handle(node, parent)
433433

434434

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

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

0 commit comments

Comments
 (0)