From 5b3202228e72857009f8c9de3723613f1c11d2f2 Mon Sep 17 00:00:00 2001
From: Yang Jingyu <1300011083@pku.edu.cn>
Date: Sun, 26 Jan 2020 21:59:05 +0800
Subject: [PATCH 1/3] change space dismatching
change space dismatching btween 4 spaces and 2 spaces,
also move yes and no outside code blocks so matching with line225
---
pyguide.md | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/pyguide.md b/pyguide.md
index c39542b60..e75afc253 100644
--- a/pyguide.md
+++ b/pyguide.md
@@ -314,9 +314,9 @@ Exceptions must follow certain conditions:
example:
- ```python
Yes:
- def connect_to_next_port(self, minimum):
+ ```python
+ def connect_to_next_port(self, minimum):
"""Connects to the next available port.
Args:
@@ -329,20 +329,20 @@ Exceptions must follow certain conditions:
ConnectionError: If no available port is found.
"""
if minimum < 1024:
- # Note that this raising of ValueError is not mentioned in the doc
- # string's "Raises:" section because it is not appropriate to
- # guarantee this specific behavioral reaction to API misuse.
- raise ValueError('Minimum port must be at least 1024, not %d.' % (minimum,))
+ # Note that this raising of ValueError is not mentioned in the doc
+ # string's "Raises:" section because it is not appropriate to
+ # guarantee this specific behavioral reaction to API misuse.
+ raise ValueError('Minimum port must be at least 1024, not %d.' % (minimum,))
port = self._find_next_open_port(minimum)
if not port:
- raise ConnectionError('Could not connect to service on %d or higher.' % (minimum,))
+ raise ConnectionError('Could not connect to service on %d or higher.' % (minimum,))
assert port >= minimum, 'Unexpected port %d when minimum was %d.' % (port, minimum)
return port
```
- ```python
No:
- def connect_to_next_port(self, minimum):
+ ```python
+ def connect_to_next_port(self, minimum):
"""Connects to the next available port.
Args:
@@ -388,9 +388,9 @@ Exceptions must follow certain conditions:
```python
try:
- raise Error()
+ raise Error()
except Error as error:
- pass
+ pass
```
From 8bff58b3855ffab995db4f6cdcd43210490827a0 Mon Sep 17 00:00:00 2001
From: Yang Jingyu <1300011083@pku.edu.cn>
Date: Mon, 27 Jan 2020 14:01:02 +0800
Subject: [PATCH 2/3] missing sub-index at line671
line671 should be 2.9.1
---
pyguide.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyguide.md b/pyguide.md
index e75afc253..312120f05 100644
--- a/pyguide.md
+++ b/pyguide.md
@@ -668,7 +668,7 @@ Use generators as needed.
-#### 2.9 Definition
+#### 2.9.1 Definition
A generator function returns an iterator that yields a value each time it
executes a yield statement. After it yields a value, the runtime state of the
From c2b6f786d830d30f52fe1acc458d603a0c49c398 Mon Sep 17 00:00:00 2001
From: Yang Jingyu <1300011083@pku.edu.cn>
Date: Mon, 27 Jan 2020 14:08:07 +0800
Subject: [PATCH 3/3] change 'yield' into inline code style
it would be better if change 'yield' into inline code style
---
pyguide.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyguide.md b/pyguide.md
index 312120f05..090a17a93 100644
--- a/pyguide.md
+++ b/pyguide.md
@@ -671,7 +671,7 @@ Use generators as needed.
#### 2.9.1 Definition
A generator function returns an iterator that yields a value each time it
-executes a yield statement. After it yields a value, the runtime state of the
+executes a `yield` statement. After it yields a value, the runtime state of the
generator function is suspended until the next value is needed.