Re: repr for lazy translation

2007-09-26 Thread Wolfram Kriesing
On 9/26/07, Andrew Durdin <[EMAIL PROTECTED]> wrote: > > On 9/26/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > > > I ran into the problem while doing this: > > > > >>> from django.utils.translation import gettext_lazy as _ > > >>> s = _("my string") > > >>> s += _("my second string") > > Tra

Re: repr for lazy translation

2007-09-26 Thread Andrew Durdin
On 9/26/07, Wolfram Kriesing <[EMAIL PROTECTED]> wrote: > > I ran into the problem while doing this: > > >>> from django.utils.translation import gettext_lazy as _ > >>> s = _("my string") > >>> s += _("my second string") > Traceback (most recent call last): > File "", line 1, in ? > TypeError:

Re: repr for lazy translation

2007-09-26 Thread Wolfram Kriesing
I ran into the problem while doing this: >>> from django.utils.translation import gettext_lazy as _ >>> s = _("my string") >>> s += _("my second string") Traceback (most recent call last): File "", line 1, in ? TypeError: unsupported operand type(s) for +=: '__proxy__' and '__proxy__' >>> the

Re: repr for lazy translation

2007-07-19 Thread Michael Radziej
Hi Malcolm, thanks for your feedback! I'm trying to anwer both mails in one (hope it works out). I'm in the mid of porting my stuff to the current trunk, and first there were of course a lot of failing doctests. After I changed the __proxy__.__str__, I was able to see the problems ('' in a trac

Re: repr for lazy translation

2007-07-19 Thread Malcolm Tredinnick
On Wed, 2007-07-18 at 18:36 +0200, Michael Radziej wrote: > Hi, > > after the unicode merge, the repr() of a lazy translation string is > '' > > This gets in my way of testing, since it used to be just the resulting > string. I'm helping myself with a > > class __proxy__(Promise): > #...

Re: repr for lazy translation

2007-07-18 Thread Jacob Kaplan-Moss
On 7/18/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > after the unicode merge, the repr() of a lazy translation string is > '' You just need to do ``unicode(laxystring)`` to get the original string. I'm sure Malcolm has a good reason for this :) Jacob --~--~-~--~~~--

repr for lazy translation

2007-07-18 Thread Michael Radziej
Hi, after the unicode merge, the repr() of a lazy translation string is '' This gets in my way of testing, since it used to be just the resulting string. I'm helping myself with a class __proxy__(Promise): #... def __repr__(self): if self.delegate_str: return repr(