From 100ac7c2dfbf875ee4a2b3d79699909d55732c3f Mon Sep 17 00:00:00 2001 From: "evgeny.bovykin" Date: Mon, 25 Aug 2025 14:43:43 +0200 Subject: [PATCH] Ignore __slots__ when matching protocol members __slots__ property is not considered to be a part of the protocol GitOrigin-RevId: e7824e6d2f9012b2fb1f561601b42480a1ba97a1 --- .../src/com/jetbrains/python/codeInsight/typing/PyProtocols.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyProtocols.kt b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyProtocols.kt index 386f7b87c102..5d74b81d53e3 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyProtocols.kt +++ b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyProtocols.kt @@ -43,6 +43,7 @@ fun inspectProtocolSubclass(protocol: PyClassType, subclass: PyClassType, contex val name = e.name ?: return@visitMembers true when (name) { + PyNames.SLOTS -> return@visitMembers true // __slots__ in a protocol definition are not considered to be a part of the protocol PyNames.CLASS_GETITEM -> return@visitMembers true PyNames.CALL -> { val types = subclass.getImplicitlyInvokedMethodTypes(null, resolveContext)