super. could there be a simpler super?

Kerim Borchaev warkid at hotbox.ru
Thu Jan 15 03:50:57 EST 2004


Hello!

  Always when I use "super" I create a code duplication because class
  used as first arg to "super" is always the class where the method
  containing "super" was defined in:
  '''
  class C:
      def method(self):
          super(C, self).method()
  '''

  Obviously the methods like the one below doesn't work "right";-)
  '''
  def super(self):
      super(self.__class__, self)
  class C:
      def method(self):
          super(self).method()
  '''

  Is it possible that such a "super"(deducing class method declaration
  context) could appear in Python?
  (It seems to me that to implement a simple super something should be
  done during "compilation" of class declaration.)

Best regards,
 Kerim                          mailto:warkid at hotbox.ru






More information about the Python-list mailing list