diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-06-10 21:06:27 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-06-10 21:06:27 (GMT) |
commit | f0aa88f6e856710c4cf5bdb23a81817a841c4553 (patch) | |
tree | 23fa8c9d4d5f27eff0879db451848465a9faeb57 | |
parent | e1076aa4e2fc164a908fc4a7e775ccf57c32c2c4 (diff) | |
download | cpython-f0aa88f6e856710c4cf5bdb23a81817a841c4553.zip cpython-f0aa88f6e856710c4cf5bdb23a81817a841c4553.tar.gz cpython-f0aa88f6e856710c4cf5bdb23a81817a841c4553.tar.bz2 |
Fixed indentation of Python examples in C comments.
-rw-r--r-- | Modules/itertoolsmodule.c | 22 | ||||
-rw-r--r-- | Objects/descrobject.c | 12 | ||||
-rw-r--r-- | Objects/typeobject.c | 8 | ||||
-rw-r--r-- | PC/bdist_wininst/install.c | 28 | ||||
-rw-r--r-- | Python/compile.c | 4 |
5 files changed, 37 insertions, 37 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index e5b2b74..394bbaf 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -2543,18 +2543,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 { diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 3e9b034..886a451 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1117,11 +1117,11 @@ PyWrapper_New(PyObject *d, PyObject *self) /* 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 @@ -1129,19 +1129,19 @@ PyWrapper_New(PyObject *d, PyObject *self) 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 index 22def74..9a221b3 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3444,10 +3444,10 @@ PyDoc_STRVAR(object_subclasshook_doc, class object: def __format__(self, format_spec): - if isinstance(format_spec, str): - return format(str(self), format_spec) - elif isinstance(format_spec, unicode): - return format(unicode(self), format_spec) + if isinstance(format_spec, str): + return format(str(self), format_spec) + elif isinstance(format_spec, unicode): + return format(unicode(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 index 8b5be61..6e6766f 100644 --- a/PC/bdist_wininst/install.c +++ b/PC/bdist_wininst/install.c @@ -1909,21 +1909,21 @@ InstallFilesDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) /* * 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 index 1f59c8c..e871d38 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2931,9 +2931,9 @@ expr_constant(expr_ty e) 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 |