Skip to content

Commit 12c5c25

Browse files
author
暮晨
committed
EX.Return return everywhere
1 parent eff078c commit 12c5c25

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ So, here we go...
2727
- [Section: Strain your brain!](#section-strain-your-brain)
2828
- [> Strings can be tricky sometimes/微妙的字符串 *](#-strings-can-be-tricky-sometimes微妙的字符串-)
2929
- [> Time for some hash brownies!/是时候来点蛋糕了!](#-time-for-some-hash-brownies是时候来点蛋糕了)
30-
- [> Return return everywhere!](#-return-return-everywhere)
30+
- [> Return return everywhere!/到处返回!](#-return-return-everywhere到处返回)
3131
- [> Deep down, we're all the same. *](#-deep-down-were-all-the-same-)
3232
- [> For what?](#-for-what)
3333
- [> Evaluation time discrepancy](#-evaluation-time-discrepancy)
@@ -248,7 +248,7 @@ some_dict[5] = "Python"
248248
249249
---
250250
251-
### > Return return everywhere!
251+
### > Return return everywhere!/到处返回!
252252
253253
```py
254254
def some_func():
@@ -264,10 +264,10 @@ def some_func():
264264
'from_finally'
265265
```
266266
267-
#### 💡 Explanation:
267+
#### 💡 说明:
268268
269-
- When a `return`, `break` or `continue` statement is executed in the `try` suite of a "try…finally" statement, the `finally` clause is also executed ‘on the way out.
270-
- The return value of a function is determined by the last `return` statement executed. Since the `finally` clause always executes, a `return` statement executed in the `finally` clause will always be the last one executed.
269+
- 当在 "try...finally" 语句的 `try` 中执行 `return`, `break` `continue` 后, `finally` 子句依然会执行.
270+
- 函数的返回值由最后执行的 `return` 语句决定. 由于 `finally` 子句一定会执行, 所以 `finally` 子句中的 `return` 将始终是最后执行的语句.
271271
272272
---
273273

0 commit comments

Comments
 (0)