0

have a python3 class method that must be overwritten at init.

is there a nice way to identify this method?

as the mybool is only give at run time standard inherits want work as i don't know which base class to inherit from before the init i and so i cant use @abstractmethod

class Foo():
   def __init__(mybool: bool):
      if mybool:
         c = _a
      else:
         c = _b

   def _a():
     #do one
     pass
   def _b():
     #do two
     pass

   def c():
     #this will never be used
     pass
Ron
  • 197
  • 1
  • 10

0 Answers0