[Python-checkins] cpython (merge 3.4 -> 3.5): Fixed indentation of Python examples in C comments.

serhiy.storchaka python-checkins at python.org
Wed Jun 10 23:10:18 CEST 2015


https://hg.python.org/cpython/rev/e71c77972de3
changeset:   96577:e71c77972de3
branch:      3.5
parent:      96573:e6a95bda2943
parent:      96576:188c9d2204f0
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Jun 11 00:07:47 2015 +0300
summary:
  Fixed indentation of Python examples in C comments.

files:
  Modules/itertoolsmodule.c  |  22 ++++++++++----------
  Objects/descrobject.c      |  12 +++++-----
  Objects/typeobject.c       |   2 +-
  PC/bdist_wininst/install.c |  28 +++++++++++++-------------
  Python/compile.c           |   4 +-
  5 files changed, 34 insertions(+), 34 deletions(-)


diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -2985,18 +2985,18 @@
     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 {
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1268,11 +1268,11 @@
 /* A built-in 'property' type */
 
 /*
-    class property(object):
+class property(object):
 
     def __init__(self, fget=None, fset=None, fdel=None, doc=None):
         if doc is None and fget is not None and hasattr(fget, "__doc__"):
-        doc = fget.__doc__
+            doc = fget.__doc__
         self.__get = fget
         self.__set = fset
         self.__del = fdel
@@ -1280,19 +1280,19 @@
 
     def __get__(self, inst, type=None):
         if inst is None:
-        return self
+            return self
         if self.__get is None:
-        raise AttributeError, "unreadable attribute"
+            raise AttributeError, "unreadable attribute"
         return self.__get(inst)
 
     def __set__(self, inst, value):
         if self.__set is None:
-        raise AttributeError, "can't set attribute"
+            raise AttributeError, "can't set attribute"
         return self.__set(inst, value)
 
     def __delete__(self, inst):
         if self.__del is None:
-        raise AttributeError, "can't delete attribute"
+            raise AttributeError, "can't delete attribute"
         return self.__del(inst)
 
 */
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4245,7 +4245,7 @@
 
    class object:
        def __format__(self, format_spec):
-       return format(str(self), format_spec)
+           return format(str(self), format_spec)
 */
 static PyObject *
 object_format(PyObject *self, PyObject *args)
diff --git a/PC/bdist_wininst/install.c b/PC/bdist_wininst/install.c
--- a/PC/bdist_wininst/install.c
+++ b/PC/bdist_wininst/install.c
@@ -1940,21 +1940,21 @@
 /*
  * The scheme we have to use depends on the Python version...
  if sys.version < "2.2":
- WINDOWS_SCHEME = {
- 'purelib': '$base',
- 'platlib': '$base',
- 'headers': '$base/Include/$dist_name',
- 'scripts': '$base/Scripts',
- 'data'   : '$base',
- }
+    WINDOWS_SCHEME = {
+    'purelib': '$base',
+    'platlib': '$base',
+    'headers': '$base/Include/$dist_name',
+    'scripts': '$base/Scripts',
+    'data'   : '$base',
+    }
  else:
- WINDOWS_SCHEME = {
- 'purelib': '$base/Lib/site-packages',
- 'platlib': '$base/Lib/site-packages',
- 'headers': '$base/Include/$dist_name',
- 'scripts': '$base/Scripts',
- 'data'   : '$base',
- }
+    WINDOWS_SCHEME = {
+    'purelib': '$base/Lib/site-packages',
+    'platlib': '$base/Lib/site-packages',
+    'headers': '$base/Include/$dist_name',
+    'scripts': '$base/Scripts',
+    'data'   : '$base',
+    }
 */
             scheme = GetScheme(py_major, py_minor);
             /* Run the pre-install script. */
diff --git a/Python/compile.c b/Python/compile.c
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -3725,9 +3725,9 @@
        BLOCK
    finally:
        if an exception was raised:
-       exc = copy of (exception, instance, traceback)
+           exc = copy of (exception, instance, traceback)
        else:
-       exc = (None, None, None)
+           exc = (None, None, None)
        exit(*exc)
  */
 static int

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list