[Checkins] SVN: z3c.form/trunk/src/z3c/form/browser/widget.py Replaced the complicated algorithm by a frozenset
Dan Korostelev
nadako at gmail.com
Thu Sep 10 11:36:26 EDT 2009
2009/9/8 Vincent Fretin <vincent.fretin at gmail.com>
> Log message for revision 103644:
> Replaced the complicated algorithm by a frozenset
>
> Changed:
> U z3c.form/trunk/src/z3c/form/browser/widget.py
>
> -=-
> Modified: z3c.form/trunk/src/z3c/form/browser/widget.py
> ===================================================================
> --- z3c.form/trunk/src/z3c/form/browser/widget.py 2009-09-08 13:14:57
> UTC (rev 103643)
> +++ z3c.form/trunk/src/z3c/form/browser/widget.py 2009-09-08 13:21:34
> UTC (rev 103644)
> @@ -54,16 +54,9 @@
> if not self.klass:
> self.klass = unicode(klass)
> else:
> - #make sure items are not repeated
> - parts = self.klass.split()+[unicode(klass)]
> - seen = {}
> - unique = []
> - for item in parts:
> - if item in seen:
> - continue
> - seen[item]=1
> - unique.append(item)
> - self.klass = u' '.join(unique)
> + # Make sure items are not repeated.
> + parts = self.klass.split() + [unicode(klass)]
> + self.klass = u' '.join(frozenset(parts))
>
This change breaks all doctests that have rendered widget classes. Did you
not test it before commit? Please, either fix the tests or revert the
change.
--
WBR, Dan Korostelev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/checkins/attachments/20090910/bf0d5437/attachment.html
More information about the checkins
mailing list