#3508: MergeDict needs more descriptive return values from __str__ and __repr__
-------------------------+--------------------------------------------------
Reporter: thebanana | Owner: adrian
Status: new | Component: Core framework
Version: SVN | Resolution:
Keywords: | Stage: Accepted
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
-------------------------+--------------------------------------------------
Comment (by thebanana):
An example of how this patch might be used:
{{{
> python2.3
Python 2.3.6 (#1, Feb 15 2007, 22:57:09)
[GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.utils.datastructures import MergeDict
>>> a = MergeDict({'a': 1, 'b': 2}, {'id': 'asdf', 'user': 'joe', 'color':
'blue'})
>>> str(a)
"{'a': 1, 'color': 'blue', 'b': 2, 'id': 'asdf', 'user': 'joe'}"
>>> repr(a)
"MergeDict({'a': 1, 'b': 2}, {'color': 'blue', 'id': 'asdf', 'user':
'joe'})"
>>>
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/3508#comment:4>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---