[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/wfmc/process.py Developed nicer, human-readable representations of several classes. Hope

Florent Guillaume fg at nuxeo.com
Fri Jul 29 09:06:12 EDT 2005


Stephan Richter  <srichter at cosmos.phy.tufts.edu> wrote:
> Log message for revision 37434:
>   Developed nicer, human-readable representations of several classes. Hope 
>   you like it! :-)

Cool.

BTW I tend to use
   "... %r ..." % foo.__name__
instead of
   "... '%s' ..." % foo.__name__
though, just for the cases where the name is Unicode...
(I've been bitten before by UnicodeDecodeError displaying objects reprs or
tracebacks or things like that.)

Florent

> --- Zope3/trunk/src/zope/wfmc/process.py	2005-07-26 20:22:04 UTC (rev 37433)
> +++ Zope3/trunk/src/zope/wfmc/process.py	2005-07-26 20:29:49 UTC (rev 37434)
> @@ -162,6 +162,10 @@
>                      self.outgoing += (transition,)                    
>          else:
>              self.outgoing = self.transition_outgoing
> +
> +    def __repr__(self):
> +        return "<ActivityDefinition '%s'>" %self.__name__

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope3-dev mailing list