Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec466a1

Browse files
Fixed indentation of Python examples in C comments.
2 parents 27da359 + 553e156 commit ec466a1

5 files changed

Lines changed: 36 additions & 36 deletions

File tree

Modules/itertoolsmodule.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,18 +2985,18 @@ def permutations(iterable, r=None):
29852985
cycles = range(n-r+1, n+1)[::-1]
29862986
yield tuple(pool[i] for i in indices[:r])
29872987
while n:
2988-
for i in reversed(range(r)):
2989-
cycles[i] -= 1
2990-
if cycles[i] == 0:
2991-
indices[i:] = indices[i+1:] + indices[i:i+1]
2992-
cycles[i] = n - i
2988+
for i in reversed(range(r)):
2989+
cycles[i] -= 1
2990+
if cycles[i] == 0:
2991+
indices[i:] = indices[i+1:] + indices[i:i+1]
2992+
cycles[i] = n - i
2993+
else:
2994+
j = cycles[i]
2995+
indices[i], indices[-j] = indices[-j], indices[i]
2996+
yield tuple(pool[i] for i in indices[:r])
2997+
break
29932998
else:
2994-
j = cycles[i]
2995-
indices[i], indices[-j] = indices[-j], indices[i]
2996-
yield tuple(pool[i] for i in indices[:r])
2997-
break
2998-
else:
2999-
return
2999+
return
30003000
*/
30013001

30023002
typedef struct {

Objects/descrobject.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,31 +1268,31 @@ PyWrapper_New(PyObject *d, PyObject *self)
12681268
/* A built-in 'property' type */
12691269

12701270
/*
1271-
class property(object):
1271+
class property(object):
12721272
12731273
def __init__(self, fget=None, fset=None, fdel=None, doc=None):
12741274
if doc is None and fget is not None and hasattr(fget, "__doc__"):
1275-
doc = fget.__doc__
1275+
doc = fget.__doc__
12761276
self.__get = fget
12771277
self.__set = fset
12781278
self.__del = fdel
12791279
self.__doc__ = doc
12801280
12811281
def __get__(self, inst, type=None):
12821282
if inst is None:
1283-
return self
1283+
return self
12841284
if self.__get is None:
1285-
raise AttributeError, "unreadable attribute"
1285+
raise AttributeError, "unreadable attribute"
12861286
return self.__get(inst)
12871287
12881288
def __set__(self, inst, value):
12891289
if self.__set is None:
1290-
raise AttributeError, "can't set attribute"
1290+
raise AttributeError, "can't set attribute"
12911291
return self.__set(inst, value)
12921292
12931293
def __delete__(self, inst):
12941294
if self.__del is None:
1295-
raise AttributeError, "can't delete attribute"
1295+
raise AttributeError, "can't delete attribute"
12961296
return self.__del(inst)
12971297
12981298
*/

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4245,7 +4245,7 @@ PyDoc_STRVAR(object_subclasshook_doc,
42454245
42464246
class object:
42474247
def __format__(self, format_spec):
4248-
return format(str(self), format_spec)
4248+
return format(str(self), format_spec)
42494249
*/
42504250
static PyObject *
42514251
object_format(PyObject *self, PyObject *args)

PC/bdist_wininst/install.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,21 +1940,21 @@ InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
19401940
/*
19411941
* The scheme we have to use depends on the Python version...
19421942
if sys.version < "2.2":
1943-
WINDOWS_SCHEME = {
1944-
'purelib': '$base',
1945-
'platlib': '$base',
1946-
'headers': '$base/Include/$dist_name',
1947-
'scripts': '$base/Scripts',
1948-
'data' : '$base',
1949-
}
1943+
WINDOWS_SCHEME = {
1944+
'purelib': '$base',
1945+
'platlib': '$base',
1946+
'headers': '$base/Include/$dist_name',
1947+
'scripts': '$base/Scripts',
1948+
'data' : '$base',
1949+
}
19501950
else:
1951-
WINDOWS_SCHEME = {
1952-
'purelib': '$base/Lib/site-packages',
1953-
'platlib': '$base/Lib/site-packages',
1954-
'headers': '$base/Include/$dist_name',
1955-
'scripts': '$base/Scripts',
1956-
'data' : '$base',
1957-
}
1951+
WINDOWS_SCHEME = {
1952+
'purelib': '$base/Lib/site-packages',
1953+
'platlib': '$base/Lib/site-packages',
1954+
'headers': '$base/Include/$dist_name',
1955+
'scripts': '$base/Scripts',
1956+
'data' : '$base',
1957+
}
19581958
*/
19591959
scheme = GetScheme(py_major, py_minor);
19601960
/* Run the pre-install script. */

Python/compile.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3630,9 +3630,9 @@ expr_constant(struct compiler *c, expr_ty e)
36303630
BLOCK
36313631
finally:
36323632
if an exception was raised:
3633-
exc = copy of (exception, instance, traceback)
3633+
exc = copy of (exception, instance, traceback)
36343634
else:
3635-
exc = (None, None, None)
3635+
exc = (None, None, None)
36363636
if not (await exit(*exc)):
36373637
raise
36383638
*/
@@ -3725,9 +3725,9 @@ compiler_async_with(struct compiler *c, stmt_ty s, int pos)
37253725
BLOCK
37263726
finally:
37273727
if an exception was raised:
3728-
exc = copy of (exception, instance, traceback)
3728+
exc = copy of (exception, instance, traceback)
37293729
else:
3730-
exc = (None, None, None)
3730+
exc = (None, None, None)
37313731
exit(*exc)
37323732
*/
37333733
static int

0 commit comments

Comments
 (0)