@@ -194,15 +194,13 @@ def __repr__(self):
194194
195195 (*) Invertible so long as collection contents are each repr-invertible.
196196 """
197- keys = self .keys ()
198- keys .sort ()
197+ keys = sorted (self .keys ())
199198 args = ", " .join (["%s=%r" % (key , self [key ]) for key in keys ])
200199 return "%s(%s)" % (self .__class__ .__name__ , args )
201200
202201 def __str__ (self ):
203202 """String-form of a OrderedBunch."""
204- keys = self .keys ()
205- keys .sort ()
203+ keys = sorted (self .keys ())
206204 args = ", " .join (["%s=%r" % (key , self [key ]) for key in keys ])
207205 return "{%s}" % args
208206
@@ -247,7 +245,7 @@ def bunchify(x):
247245 nb. As dicts are not hashable, they cannot be nested in sets/frozensets.
248246 """
249247 if isinstance (x , dict ):
250- return Bunch ((k , bunchify (v )) for k , v in x .iteritems ())
248+ return Bunch ((k , bunchify (v )) for k , v in x .items ())
251249 elif isinstance (x , (list , tuple )):
252250 return type (x )(bunchify (v ) for v in x )
253251 else :
@@ -273,7 +271,7 @@ def unbunchify(x):
273271 nb. As dicts are not hashable, they cannot be nested in sets/frozensets.
274272 """
275273 if isinstance (x , dict ):
276- return dict ((k , unbunchify (v )) for k , v in x .iteritems ())
274+ return dict ((k , unbunchify (v )) for k , v in x .items ())
277275 elif isinstance (x , (list , tuple )):
278276 return type (x )(unbunchify (v ) for v in x )
279277 else :
0 commit comments