All pastes #73906 Raw Edit

HowardTheCoward

public python v1 · immutable
#73906 ·published 2006-06-28 12:50 UTC
rendered paste body
#!/usr/bin/pythonclass AbstractClass:#{{{	'''		Abstract class	'''	def __init__(self):#{{{		self._check_instantiation()	#}}}	def _check_instantiation(self):#{{{		'''			Anti-instantiation trap		'''		if self.__class__.__name__ == 'AbstractClass':			raise Exception('Can not instantiate abstract class AbstractClass')	#}}}#}}}class ChildClass(AbstractClass):#{{{	def __init__(self):#{{{		pass	#}}}#}}}#ac = AbstractClass() #raises an exceptioncc = ChildClass()