Files
python-cinderclient/cinderclient/tests/unit/v1
xianming mao 44507540f6 Python3 common patterns
Modify some codes in order to lead them meet the python3 common pattern.
Look through the following patterns of Cinder,
      map() and filter() if a list is needed on Python 3:
          Replace map(func, data) with [func(item) for item in data]
          Replace filter(lambda obj: test(obj), data) with
             [obj for obj in data if test(obj)]
      Replace exceptions.OSError with OSError and
         remove "import exceptions"
      Replace iterator.next() with next(iterator)
      Replace basestring with six.string_types
      Replace unicode with six.text_type
      Replace (str, unicode) with six.string_types
      Replace "for key in dict.iterkeys()" with "for key in dict"
      Replace dict.iteritems() with dict.items()
      Replace dict.itervalues() with dict.values()
I found that only "filter(lambda obj: test(obj), data)" and
"map(func, data)"need to modify.
The other items are not be founded in Cinder.

Reference:https://wiki.openstack.org/wiki/Python3#Common_patterns

Change-Id: If33ec39eb176c14086132d3099c6ec577f956ded
2017-01-10 08:55:30 +00:00
..
2016-09-11 06:01:23 +00:00
2017-01-10 08:55:30 +00:00
2015-06-01 15:33:18 -04:00