Skip to content

Commit 676cfb4

Browse files
committed
fix: Fix identity checks in inspector when handling attributes
1 parent a319f65 commit 676cfb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/_griffe/agents/inspector.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from _griffe.agents.nodes.runtime import ObjectNode
1313
from _griffe.collections import LinesCollection, ModulesCollection
14-
from _griffe.enumerations import ObjectKind, ParameterKind
14+
from _griffe.enumerations import Kind, ParameterKind
1515
from _griffe.expressions import safe_get_annotation
1616
from _griffe.extensions.base import Extensions, load_extensions
1717
from _griffe.importer import dynamic_import
@@ -483,18 +483,18 @@ def handle_attribute(self, node: ObjectNode, annotation: str | Expr | None = Non
483483
self.extensions.call("on_node", node=node, agent=self)
484484
self.extensions.call("on_attribute_node", node=node, agent=self)
485485

486-
# TODO: to improve
486+
# TODO: To improve.
487487
parent = self.current
488488
labels: set[str] = set()
489489

490-
if parent.kind is ObjectKind.MODULE:
490+
if parent.kind is Kind.MODULE:
491491
labels.add("module")
492-
elif parent.kind is ObjectKind.CLASS:
492+
elif parent.kind is Kind.CLASS:
493493
labels.add("class")
494-
elif parent.kind is ObjectKind.FUNCTION:
494+
elif parent.kind is Kind.FUNCTION:
495495
if parent.name != "__init__":
496496
return
497-
parent = parent.parent
497+
parent = parent.parent # type: ignore[assignment]
498498
labels.add("instance")
499499

500500
try:

0 commit comments

Comments
 (0)