On 3/11/06, Glenn Tenney <[EMAIL PROTECTED]> wrote:
>
> Turns out that I mistakenly had created a class with a __repr__ that
> returned a integer field instead of a "str".  When I changed it to
> "return str(self.value)" debug again worked fine.
>
> I don't know if I'd call this a bug or not, but... I sure wish that
> using a debug wouldn't protect itself from exceptions...
>
> Yes, the docs do say:
>
>    Thus, you should always return a nice, human-readable string for
>    the object's __repr__.

It's not just a Django thing - it's a python-wide convention.

However, if 10c of code in Django would have saved you $100 of
debugging, it might be a worthwhile modification. 'Silent failure' is
a common theme throughout Django templating, but getting full
exceptions in the debug tag (or even just a warning that __repr__
doesn't appear to be returning a string) could be helpful.

Its worth logging this as an enhancement request
(http://code.djangoproject.com/newticket) to make sure the idea isn't
forgotten.

Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to