MAJ terminée. Nous sommes passés en version 14.6.2 . Pour consulter les "releases notes" associées c'est ici :

Commit 49764000 by Mathieu Giraud

### utils.py: 2to3, remove cmp, update test with dict

parent 4455a440
 ... @@ -24,8 +24,12 @@ def concatenate_with_padding(d, ... @@ -24,8 +24,12 @@ def concatenate_with_padding(d, >>> d1 = { 'a': [1, 2], 'b': [11, 22], 'z':17 } >>> d1 = { 'a': [1, 2], 'b': [11, 22], 'z':17 } >>> d2 = { 'a': [3, 4, 5], 'c': [333, 444, 555] } >>> d2 = { 'a': [3, 4, 5], 'c': [333, 444, 555] } >>> concatenate_with_padding(d, d1, 2, d2, 5, ['z']) >>> concatenate_with_padding(d, d1, 2, d2, 5, ['z']) >>> d >>> d['a'] {'a': [1, 2, 3, 4, 5], 'c': [0, 0, 333, 444, 555], 'b': [11, 22, 0, 0, 0, 0, 0]} [1, 2, 3, 4, 5] >>> d['b'] [11, 22, 0, 0, 0, 0, 0] >>> d['c'] [0, 0, 333, 444, 555] ''' ''' t1=[] t1=[] ... @@ -108,7 +112,7 @@ def common_substring(l): ... @@ -108,7 +112,7 @@ def common_substring(l): table += set(s[j:k] for j in range(len(s)) for k in range(j+1, len(s)+1)) table += set(s[j:k] for j in range(len(s)) for k in range(j+1, len(s)+1)) # sort substrings by length (descending) # sort substrings by length (descending) table = sorted(table, cmp=lambda x,y: cmp(len(y), len(x))) table = sorted(table, key=lambda x:-len(x)) # get the position of duplicates and get the first one (longest) # get the position of duplicates and get the first one (longest) duplicates=[i for i, x in enumerate(table) if table.count(x) == len(l)] duplicates=[i for i, x in enumerate(table) if table.count(x) == len(l)] if len(duplicates) > 0: if len(duplicates) > 0: ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!