﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
4541	gettext_lazy doesn't work with __cmp__	Favo <favo@…>	Adrian Holovaty	"if you compare two gettext_lazy objects, will raise error:
{{{
#!python
from django.utils.translation import gettext_lazy as _
assert _(""value"") == _(""value"")
}}}
{{{
Traceback (most recent call last):
  File ""testlazy.py"", line 3, in ?
    assert _(""value1"") == _(""value2"")
  File ""/lib/django/django/utils/functional.py"", line 43, in __wrapper__
    return self.__dispatch[type(res)][funcname](res, *args, **kw)
KeyError: '__cmp__'
}}}

Not sure there's easy way to fix. Because the lazy object try to wrapper all function, and store them in a {{{__dispatch}}} dict. the {{{__dispatch}}} come from {{{type.__dict__}}}. But {{{str.__dict__}}} do not contain {{{__cmp__}}}. This will not a issue if unicode branch merged, since {{{unicode.__dict__}}} contain {{{__cmp__}}}. 

Currently I just call str() to across the issue:
{{{
#!python
assert str(_(""value"")) == _(""value"")
}}}

"		closed	Tools	dev		fixed		favo@…	Unreviewed	0	0	0	0	0	0
