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 "<console>", line 1, in ?
TypeError: unsupported operand type(s) for +=: '__proxy__' and '__proxy__'
>>>

the following does work, but makes it very unpleasent to program

>>> s = unicode(_("my string"))
>>> s += unicode(_("my second string"))
>>>

is that really the way its thought to work? if so, it breaks BC and
its not handy and intuitive.
just my 2 cents

cu

wolfram



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


-- 
cu

Wolfram

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to