Skip to content

Instantly share code, notes, and snippets.

@Enchan1207
Created June 23, 2023 04:26
Show Gist options
  • Save Enchan1207/5b2df0dc708a98dc5c18184a76615c1a to your computer and use it in GitHub Desktop.
Save Enchan1207/5b2df0dc708a98dc5c18184a76615c1a to your computer and use it in GitHub Desktop.
abstract class in abstract class
#
#
#
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()
#
#
#
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