mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[gyb] Work-around PEP 3106 for Python 3 compatibility
PEP 3106 [1] changed the behavior of the dictionaries `items` method. In Python 2, `items` builds a real list of tuples where `iteritems` returns a generator. PEP 3106 changes Python 3's `items` method to be equivalent to Python 2's `iteritems` and completely removes `iteritems` in Python 3. This patch switches to both to use `items`. This could have a negative impact on Python 2's performance because it now causes the dictionary tuples to be built in memory. [1] https://www.python.org/dev/peps/pep-3106/
This commit is contained in:
@@ -66,7 +66,7 @@ class GraphemeClusterBreakPropertyTable(UnicodeProperty):
|
||||
# values to symbolic values.
|
||||
self.symbolic_values = \
|
||||
[ None ] * (max(self.numeric_value_table.values()) + 1)
|
||||
for k,v in self.numeric_value_table.iteritems():
|
||||
for k,v in self.numeric_value_table.items():
|
||||
self.symbolic_values[v] = k
|
||||
|
||||
# Load the data file.
|
||||
|
||||
Reference in New Issue
Block a user