[qmtest] [PATCH] fix "save expectation" command
Nathaniel Smith
njs at pobox.com
Wed Jul 16 07:17:48 UTC 2003
On Tue, Jul 15, 2003 at 10:39:21PM -0700, Mark Mitchell wrote:
> On Tue, 2003-07-15 at 21:55, Vladimir Prus wrote:
> > Mark Mitchell wrote:
> > > On Mon, 2003-07-14 at 22:33, Vladimir Prus wrote:
> > > > The command is broken because since 2003-05-09 the Result.__init__ method
> > > > does not have "context" parameter, while
> > > > QMTestSever.HandleSaveExpectations tries to pass it.
> > >
> > > I applied this patch.
> >
> > BTW, could you tell why QMTest uses:
> >
> > super(TemporaryAttachmentStore, self).__init__(path)
> >
> > instead of
> >
> > FileAttachmentStore.__init__(self, path)
>
> This is a new feature in Python that, as you say, avoids having to
> explicitly name the super class. It would be even nicer if you could
> just say "super(self).__init__(path)", but you can't, and there are some
> technical reasons for that.
It also works correctly in the case of multiple inheritance, which
wasn't really possible to get right before.
http://www.python.org/2.2.1/descrintro.html is probably the best
current documentation on this stuff.
You could actually use a little metaclass to make sugar like
self.__super.__init__(path) work, but perhaps that's getting a bit
overkill.
-- Nathaniel
--
"...these, like all words, have single, decontextualized meanings: everyone
knows what each of these words means, everyone knows what constitutes an
instance of each of their referents. Language is fixed. Meaning is
certain. Santa Claus comes down the chimney at midnight on December 24."
-- The Language War, Robin Lakoff
More information about the qmtest
mailing list