Created
June 23, 2023 04:26
-
-
Save Enchan1207/5b2df0dc708a98dc5c18184a76615c1a to your computer and use it in GitHub Desktop.
abstract class in abstract class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
# | |
from abc import ABCMeta, abstractmethod | |
class Meta(metaclass=ABCMeta): | |
class MetaChildren(metaclass=ABCMeta): | |
@abstractmethod | |
def metachil(self) -> str: | |
raise NotImplementedError() | |
@abstractmethod | |
def meta(self) -> int: | |
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
# | |
from abst import Meta | |
class Concre(Meta): | |
class ConcreChildren(Meta.MetaChildren): | |
def metachil(self) -> str: | |
return "metachil!" | |
def meta(self) -> int: | |
a = self.ConcreChildren() | |
return 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment