On Fri, Aug 12, 2011 at 2:13 PM, Michael Hanselmann <[email protected]> wrote: > This will be used to add some more details to type descriptions, e.g. on > opcode parameters or result values. The implementation is very similar > to “WithDesc”. > > I chose to use “[…]” after finding “/*…*/” hard to read and spot. At > some we'll have to introduce proper formatting (e.g. using HTML). > > Example with a comment: > List of ((Length 2) and (Item 0 is (NonEmptyString [name of changed > parameter]), item 1 is Anything)) > > Signed-off-by: Michael Hanselmann <[email protected]>
LGTM, with once minor comment. > --- > lib/ht.py | 30 +++++++++++++++++++++++++++++- > 1 files changed, 29 insertions(+), 1 deletions(-) > > diff --git a/lib/ht.py b/lib/ht.py > index d1a8df9..4a511dc 100644 > --- a/lib/ht.py > +++ b/lib/ht.py > @@ -46,7 +46,7 @@ def Parens(text): > return "(%s)" % text > > > -class _DescWrapper(object): > +class _WrapperBase(object): > __slots__ = [ > "_fn", > "_text", > @@ -59,16 +59,31 @@ class _DescWrapper(object): > @param fn: Wrapped function > > """ > + assert text.strip() > + So you just want to make sure it's not empty, but don't you also want to use the stripped text? René
