#7718: sorted() is used by system tests, but isn't available on Python 2.3
------------------------------+---------------------------------------------
 Reporter:  russellm          |       Owner:  nobody    
   Status:  new               |   Milestone:  1.0       
Component:  Unit test system  |     Version:  SVN       
 Keywords:                    |       Stage:  Unreviewed
Has_patch:  0                 |  
------------------------------+---------------------------------------------
 One of the proposed patches for #7303 correctly identified that sorted()
 is not available under Python 2.3. sorted() is used extensively in the
 Django system tests as a way of removing a dependency on dict ordering.

 As at [7890], the following instances exist:
 {{{
 tests/modeltests/basic/models.py:>>> [sorted(d.items()) for d in dicts]
 tests/modeltests/or_lookups/models.py:>>> [sorted(d.items()) for d in
 dicts]
 tests/regressiontests/admin_scripts/management/commands/app_command.py:
 print 'EXECUTE:AppCommand app=%s, options=%s' % (app,
 sorted(options.items()))
 tests/regressiontests/admin_scripts/management/commands/base_command.py:
 print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels,
 sorted(options.items()))
 tests/regressiontests/admin_scripts/management/commands/label_command.py:
 print 'EXECUTE:LabelCommand label=%s, options=%s' % (label,
 sorted(options.items()))
 tests/regressiontests/admin_scripts/management/commands/noargs_command.py:
 print 'EXECUTE:NoArgsCommand options=%s' % sorted(options.items())
 tests/regressiontests/defaultfilters/tests.py:>>> [sorted(dict.items())
 for dict in sorted_dicts]
 tests/regressiontests/defaultfilters/tests.py:>>> [sorted(dict.items())
 for dict in sorted_dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/model_inheritance_regress/models.py:>>>
 [sorted(d.items()) for d in dicts]
 tests/regressiontests/queries/models.py:>>> [sorted(d.items()) for d in
 dicts]
 tests/regressiontests/queries/models.py:>>> [sorted(d.items()) for d in
 dicts]
 tests/regressiontests/utils/datastructures.py:>>>
 sorted(real_dict.values())
 }}}

 We could just replace the use of sorted() with sort(); a better approach
 (cleaner in terms of final output) would be to introduce a definition of
 sorted() when it is not available, much in the same way that set is
 imported when it is not available.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7718>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to