Commits

ianb  committed 7d26314

Fix #190: reversed on python2.3

  • Participants
  • Parent commits 689ad10

Comments (0)

Files changed (4)

File docs/news.txt

 News
 ====
 
+svn trunk
+---------
+
+* Python 2.3 compatibility: backport of ``reversed(seq)``
+
 0.8.1
 -----
 

File webob/headerdict.py

 """
 
 from webob.multidict import MultiDict
+try:
+    reversed
+except NameError:
+    from webob.util.reversed import reversed
 
 class HeaderDict(MultiDict):
 

File webob/multidict.py

 import copy
 import sys
 from webob.util.dictmixin import DictMixin
+try:
+    reversed
+except NameError:
+    from webob.util.reversed import reversed
 
 __all__ = ['MultiDict', 'UnicodeMultiDict', 'NestedMultiDict', 'NoVars']
 

File webob/util/reversed.py

+## Backport of reversed
+
+def reversed(seq):
+    return iter(list(seq)[::-1])