From 0dd9e0876f01f62860e985d6c5ca487fc47ee43b Mon Sep 17 00:00:00 2001 From: Lionel H Date: Mon, 8 Jul 2024 11:10:52 +0200 Subject: [PATCH] feat(erg): add subclasshook method in abc.d.er Add __subclasshook__ magic method which is used to implement the logic that validates a class correctly conform to an interface. Signed-off-by: Lionel H --- crates/erg_compiler/lib/pystd/abc.d.er | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/erg_compiler/lib/pystd/abc.d.er b/crates/erg_compiler/lib/pystd/abc.d.er index c4711a46..a9e73efc 100644 --- a/crates/erg_compiler/lib/pystd/abc.d.er +++ b/crates/erg_compiler/lib/pystd/abc.d.er @@ -7,6 +7,7 @@ .ABCMeta. __instancecheck__: (self: .ABCMeta, instance: Obj) -> Bool __subclasscheck__: (self: .ABCMeta, subclass: Type) -> Bool + __subclasshook__: (self: .ABCMeta, subclass: Type) -> Bool register: (self: .ABCMeta, subclass: Type) -> NoneType .ABC: ClassType