Should HTMLClass::history and _HTMLItem::history have the same signature?

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi all:

In my user.item.html template I call:

   tal:replace="structure python:context.history(limit=limit)"

I got a traceback because history doesn't support limit if this code
is rendered using the url ending in:

  user?@template=item

If the user ends in:

  user1

the code works fine. I think what is happening is in the user1 case I
am invoking _HTMLItem's history method with signature:

  history(self, direction='descending', dre=re.compile(r'^\d+$'),
                limit=None, showall=False ):

while in the user?@template=item case I am invoking HTMLClass's
history that has the signature:

  history(self)

I think these two signatures should be compatible. I suggest changing
the HTMLClass's definition to:

  history(self, **args)

so it accepts (but ignores) any arguments that would be valid for
_HTMLItem::history().

I could also add all the args for _HTMLItem::history() to
HTMLClass::history(). However this increases the maintenance burden as
any future arguments to _HTMLItem::history() would have to be added to
HTMLClass::history().

Thoughts? 

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.