mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fixed indentation of Python examples in C comments.
This commit is contained in:
commit
553e156921
5 changed files with 34 additions and 34 deletions
|
@ -2985,18 +2985,18 @@ def permutations(iterable, r=None):
|
|||
cycles = range(n-r+1, n+1)[::-1]
|
||||
yield tuple(pool[i] for i in indices[:r])
|
||||
while n:
|
||||
for i in reversed(range(r)):
|
||||
cycles[i] -= 1
|
||||
if cycles[i] == 0:
|
||||
indices[i:] = indices[i+1:] + indices[i:i+1]
|
||||
cycles[i] = n - i
|
||||
for i in reversed(range(r)):
|
||||
cycles[i] -= 1
|
||||
if cycles[i] == 0:
|
||||
indices[i:] = indices[i+1:] + indices[i:i+1]
|
||||
cycles[i] = n - i
|
||||
else:
|
||||
j = cycles[i]
|
||||
indices[i], indices[-j] = indices[-j], indices[i]
|
||||
yield tuple(pool[i] for i in indices[:r])
|
||||
break
|
||||
else:
|
||||
j = cycles[i]
|
||||
indices[i], indices[-j] = indices[-j], indices[i]
|
||||
yield tuple(pool[i] for i in indices[:r])
|
||||
break
|
||||
else:
|
||||
return
|
||||
return
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue