mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 04:09:05 +00:00
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 <lionel.hubaut@dekimo.com>
This commit is contained in:
parent
2d8a673fee
commit
0dd9e0876f
1 changed files with 1 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
.ABCMeta.
|
.ABCMeta.
|
||||||
__instancecheck__: (self: .ABCMeta, instance: Obj) -> Bool
|
__instancecheck__: (self: .ABCMeta, instance: Obj) -> Bool
|
||||||
__subclasscheck__: (self: .ABCMeta, subclass: Type) -> Bool
|
__subclasscheck__: (self: .ABCMeta, subclass: Type) -> Bool
|
||||||
|
__subclasshook__: (self: .ABCMeta, subclass: Type) -> Bool
|
||||||
register: (self: .ABCMeta, subclass: Type) -> NoneType
|
register: (self: .ABCMeta, subclass: Type) -> NoneType
|
||||||
|
|
||||||
.ABC: ClassType
|
.ABC: ClassType
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue