comparison babel/util.py @ 529:5b62a9699780

Get rid of the utility code for itemgetter(), we now simply import this from operator.
author jruigrok
date Sat, 05 Mar 2011 15:06:28 +0000
parents 5e1804d27d65
children e93f68837913
comparison
equal deleted inserted replaced
528:86d221c0eb12 529:5b62a9699780
18 import os 18 import os
19 import re 19 import re
20 import textwrap 20 import textwrap
21 import time 21 import time
22 from itertools import izip, imap 22 from itertools import izip, imap
23 try:
24 from operator import itemgetter
25 except ImportError:
26 def itemgetter(item):
27 return lambda obj: obj[item]
28 23
29 missing = object() 24 missing = object()
30 25
31 __all__ = ['distinct', 'pathmatch', 'relpath', 'wraptext', 'odict', 'UTC', 26 __all__ = ['distinct', 'pathmatch', 'relpath', 'wraptext', 'odict', 'UTC',
32 'LOCALTZ'] 27 'LOCALTZ']
Copyright (C) 2012-2017 Edgewall Software