-
Notifications
You must be signed in to change notification settings - Fork 34
「イテレータブルオブジェクト」」を「反復可能なオブジェクト」に修正 #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
"iterable"のカタカナ表記なので「イテラブル」のほうが適切 https://docs.python.org/3/glossary.html#term-iterable
takanory
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。コメントしました
source/textbook/4_collections.md
Outdated
| ``` | ||
|
|
||
| 各メソッドの戻り値はイテレータブルオブジェクトです。 | ||
| 各メソッドの戻り値はイテラブルオブジェクトです。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
調べてみたところ、各メソッドの戻り値はビューオブジェクトと言うらしいです。
https://docs.python.org/ja/3.14/library/stdtypes.html#dict.keys
https://docs.python.org/ja/3.14/library/stdtypes.html#dictionary-view-objects
source/textbook/4_collections.md
Outdated
| ```{admonition} コラム: イテレータブルオブジェクト | ||
| `.keys()` 、 `.values()` 、 `.items()` の戻り値の型はリストやタプルではなくそれぞれ `dict_keys` 、 `dict_values`、 `dict_items` ですが、いずれも `for` 文でデータを取り出すことができます。Pythonの `for` 文は、「イテレータブルオブジェクト」という連続したデータ構造を表すオブジェクトであれば扱えるため、このような動きになります。 | ||
| ```{admonition} コラム: イテラブルオブジェクト | ||
| `.keys()` 、 `.values()` 、 `.items()` の戻り値の型はリストやタプルではなくそれぞれ `dict_keys` 、 `dict_values`、 `dict_items` ですが、いずれも `for` 文でデータを取り出すことができます。Pythonの `for` 文は、「イテラブルオブジェクト」という連続したデータ構造を表すオブジェクトであれば扱えるため、このような動きになります。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for文に渡せるのは「イテラブルオブジェクト」または「反復可能なオブジェクト」ですね。
公式ドキュメントにあわせて「反復可能なオブジェクト(iterable object)」とするのはどうでしょうか。
https://docs.python.org/ja/3.14/reference/compound_stmts.html#the-for-statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「辞書のビューオブジェクトは反復可能なオブジェクトなので、for文でデータを取り出すことができます。」
みたいな文章にするのはどうでしょうか
|
contributors.mdに名前の追加もぜひお願いします 🙇 |
"iterable"のカタカナ表記なので「イテラブル」のほうが適切だと思いました。もし意図した訳語でしたらご放念ください。
チケットへのリンク: 無し
このレビューで確認して欲しい点
contributorに追加を希望する場合は、以下にチェックを入れて
source/organize/3_contributers.mdに自分の名前を入れた変更をこのPull Requestに加えること