Skip to content

Commit 1bf3237

Browse files
authored
Merge pull request #3202 from Wicirelllis/fix-typo-scala-for-python-devs
Fix typo
2 parents 002f8a2 + bd512fd commit 1bf3237

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

_overviews/scala3-book/scala-for-python-devs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ Some informational and mathematical methods:
12091209
| `c.find(p)` | Returns the first element that matches `p`. The element is returned as `Option[A]`. |
12101210
| `c.min` | Returns the smallest element from the collection. (Can throw _java.lang.UnsupportedOperationException_.) |
12111211
| `c.max` | Returns the largest element from the collection. (Can throw _java.lang.UnsupportedOperationException_.) |
1212-
|`c slice(from, to)` | Returns the interval of elements beginning at element `from`, and ending at element `to`. |
1212+
| `c.slice(from, to)` | Returns the interval of elements beginning at element `from`, and ending at element `to`. |
12131213
| `c.sum` | Returns the sum of all elements in the collection. (Requires an `Ordering` be defined for the elements in the collection.) |
12141214

12151215
Here are a few examples that demonstrate how these methods work on a list:

_zh-cn/overviews/scala3-book/scala-for-python-devs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ Scala 集合类有超过 100 种功能方法来简化您的代码。
11761176
| `c.find(p)` | 返回匹配 `p` 的第一个元素。该元素以 `Option[A]` 的形式返回。 |
11771177
| `c.min` | 返回集合中的最小元素。 (可以抛出_java.lang.UnsupportedOperationException_。)|
11781178
| `c.max` | 返回集合中的最大元素。 (可以抛出_java.lang.UnsupportedOperationException_。)|
1179-
| `c slice(from, to)` | 返回从元素 `from` 开始到元素 `to` 结束的元素间隔。 |
1179+
| `c.slice(from, to)` | 返回从元素 `from` 开始到元素 `to` 结束的元素间隔。 |
11801180
| `c.sum` | 返回集合中所有元素的总和。 (需要为集合中的元素定义 `Ordering`。) |
11811181

11821182
以下是一些示例,展示了这些方法如何在列表上工作:

0 commit comments

Comments
 (0)