目的
英語と日本語、両方使ってPythonを丁寧に学ぶ。
(
頭に入れておくと役立つ気がするものに印を入れました)
(個人的な動機は別として、)手元に、
「入門 Python3」オライリー・ジャパン(2017年2月3日 初版第6刷発行)
「introducing Python」 O'Reilly Media,Inc (First Edition 2016-02-26 Third release)
の日本語と英語の書籍が両方あります。
以前、用語に関して、
日本語と英語の対応
がよくわからなかった場合があるので、それを整理し、その作業を通して、Pythonの理解を深めたいと思います。
日本語は、よく読まれている上記の書籍の記載を基準とします。
(Pythonに限った内容でないものも多く含まれます、あえて、含んでいます。)
以下からも情報を追加。
https://docs.python.org/3/reference/datamodel.html
(広げて https://docs.python.org/3/reference/)
https://docs.python.org/ja/3/reference/datamodel.
(広げて https://docs.python.org/ja/3/reference/)
更に、以下も。
https://docs.python.org/3/glossary.html
https://docs.python.org/ja/3/glossary.html
単語
漢字を含む編
| 日本語 | 英語 | 備考 |
|---|---|---|
| 代入する | assign | substituteよりこっち? |
| 代入 | assignment |
substitutionよりこっち? |
| 辞書 | dictionary | ディクショナリではない |
| 辞書 | dict | この呼び方もあると記載 |
| ラムダ関数 | lambda function | |
| 無名関数 | anonymous function | |
| 対話型インタープリタ | interractive interpreter | |
| 波かっこ | curly brackets | {} ※python特有のことではない |
| 角かっこ | sqare brackets | [] ※python特有のことではない |
| 数値 | numbers | |
| 集合 | sets | |
| 優先順位 | precedence | |
| 基数 | bases | base 10とか |
| 組込み | built-in | |
| ->組込み関数 | ->built-in function | |
| 名前 | name | |
| 名前空間 | namespaces | |
| 並行処理 | concurrency | |
| 分散コンピューティング | distributed computing | |
| シリアライズ(直列化) | serialize | ※1 |
| (実)引数 | arguments | ※2 |
| ->位置引数 | positional arguments | |
| (仮)引数 | parameters | ※2 |
| 動的言語 | dynamic languages | |
| スクリプト言語 | scripting languages | |
| 属性 | attributes | |
| 整数 | integer | |
| 整数(の) | integral | |
| 複数行 | multiline | |
| ↑ | multiple lines | |
| ->複数行文字列 | ->multiline strings | |
| 実装(されている) | (is) implemented | |
| 文 | statement | ※3 |
| 式 | expression | ※3 |
| ->式文 | ->expression statement | ※3 |
| 修飾(する) | qualifying | |
| 別名 | another name | |
| 配列 | array | |
| ->多次元配列 | multidimensional array | |
| ->数値配列 | numeric array | ※numericalじゃなく |
| 参照 | reference | |
| 名前をつける | attach a name | |
| 非公開 | private | |
| 非公開属性 | privacy | |
| 空 | null, empty | |
| ->空集合 | null set, empty set | |
| 改行 | newline | ※4 |
| 識別子 | identifier (identifiers) |
|
| 実行ファイル | executable |
|
| 意味を持つ | make(s) sense | 例. on systems where this makes sense. |
| 使い方 | usage | |
| 正規表現 | regular expressions | 「単語の意味からずれている例」参照 |
| ※1 Saving data structures to a file is called serializing.(本文抜 |
||
| ※2 日本語は、単に、引数という場合が多い。 | ||
| ※3 式と文は区別しましょう。関連記載参照。 | ||
| ※4 newlineの説明は、以下、参照。 | ||
| (引用元:https://en.wikipedia.org/wiki/Newline) |
Newline (frequently called line ending, end of line (EOL), line feed, or line break) is a control character or sequence of control characters in a character encoding specification (e.g. ASCII or EBCDIC) that is used to signify the end of a line of text and the start of a new one.
カタカナ編
| 日本語 | 英語 | 備考 |
|---|---|---|
| スライス | slice | |
| イテラブル | iterable | |
| イテレータ | iterator | |
| ミュータブル | mutable | |
| 変更可能な* | ↑ | |
| イミュータブル | immutable | |
| 変更不能な | ↑ | |
| クロージャ | closures | |
| シーケンス | sequence | ※1 |
| モジュール | modules | ※2 |
| バウンド | bound | |
| ->CPUバウンド | ->CPU bound | |
| シェルプログラム | shell program | |
| メソッド | methods | |
| ハッシュ | hash | 辞書の他の言語での呼び方の例として記載 |
| ハッシュマップ | hashmap | 辞書の他の言語での呼び方の例として記載 |
| トークン | token | |
| (値を)コピーする | copy (a value) | |
| マングリング | mangling | |
| マングリングする | mangle | ※3 |
| ドキュメンテーション | documentation | |
| ->ドキュメンテーション文字列 | documentation string | |
| インスタンス(実体、実例) | instance | |
| バイト | bytes | ※5 |
| ->バイト列 | bytearray | ※4※5 |
| ->バイトシーケンス | byte sequence | ※4※5 |
| ※1 言葉の説明というよりは、言語仕様の説明になるかもれいないが、シーケンス型として、リスト、タプル、range、文字列などがあるらしい。 | ||
| 参考: | ||
| PythonのData model(データモデル)のThe standard type hierarchy(標準型の階層) | ||
| ※2 モジュールは、pythonコードをまとめたファイル。 | ||
| A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. (3.7.3仕様書) | ||
| ※3 「(ぐちゃぐちゃに変形する)」との補足記載あり。 | ||
| ※4 byte stirings と書かれているところもある。 | ||
| ※5 bytes、bytearrayを明確に使い分けている場合は、注意。使い分ける場合は、通常、英語表記。 | ||
| 別項参照。 |
使い慣れない日本語編
| 日本語 | 英語 | 備考 |
|---|---|---|
| 内包表記 | comprehension | |
| -> リスト内包表記 | -> list comprehension | |
| 特殊メソッド | special methods | マジックメソッド、magic methodsと呼ばれる場合ありと補足あり |
| 連想記憶 | associative arrays | 辞書の他の言語での呼び方の例として記載 |
| 副作用 | the side effects |
定義
定義が重要な単語を以下に示す。
| attribute |
|---|
| (属性) オブジェクトに関連付けられ、ドット表記式によって名前で参照される値です。例えば、オブジェクト o が属性 a を持っているとき、その属性は o.a で参照されます。 |
| A value associated with an object which is referenced by name using dotted expressions. For example, if an object o has an attribute a it would be referenced as o.a. |
[補足]英語と日本語、文章レベルで対比
補足として、文書レベルの対比を示す。
| reference ※引用 上段:[a1]、下段:[a2] |
|---|
| 変数はただの名前だ。代入したからといって値はコピーされない。データを入れているオブジェクトに名前を付けるだけだ。名前は値自体ではなく値の参照である。 |
| variables are just names. Assingment does not copy a value;it just attaches a name to the object that contains the data.The name is a reference to a thing rather than the thing itself. |
| attributes ※引用 上段:[a1]、下段:[a2] |
|---|
| オブジェクトには、データ(変数、属性と呼ばれる)とコード(関数、メソッドと呼ばれる)の両方が含まれている。オブジェクトは、なんらかの具体的なものの一意な**インスタンス(実体、実例)**を表している。 |
| An object contains both data(variables, called attributes) and code (functions, called methods).It represents a unique instance of some concrete thing. |
| bytes, bytearray ※引用 上2段:[a1]、下2段:[a2] |
|---|
| ・bytesはイミュータブルで、バイトのタプルのようなものだ。 |
| ・bytearrayはミュータブルで、バイトのリストのようなものだ。 |
| ・bytes is imuutable, like a tuple of bytes |
| ・bytearray is mutable, like a list of bytes |
| make(s) sense ※引用 上2段:[a3]、下2段:[a4] |
|---|
| Python インタプリタの実行ファイルの絶対パスを示す文字列です。このような名前が意味を持つシステムで利用可能です。 |
| A string giving the absolute path of the executable binary for the Python interpreter, on systems where this makes sense. |
※[a1]「入門 Python3」オライリー・ジャパン(2017年2月3日 初版第6刷発行)
[a2]「introducing Python」 O'Reilly Media,Inc (First Edition 2016-02-26 Third release)
[a3] https://docs.python.org/ja/3/reference/
[a4] https://docs.python.org/3/reference/
定義が、ぶれる例
・「属性」(attributes)
「属性」は、「属性」と「メソッド」という感じで分けて使われることが多いが、「属性参照」や
dir関数の説明においては、広義の「属性」(属性も属性、メソッドも属性)という定義として使われているようである。(用語の数には、限りがあるし、その程度のあいまいさは、当然、あると思う。)
単語の意味からずれている例
英語がずれて、そのまま日本語がずれている例
正規表現(regular expressions)
regular expressionsから、正規表現が今、意味してるものをイメージすることはできないと思う。
下記のwikiから考えると、
「regular language」で使っていたexpressionsという感じか。
出典:https://en.wikipedia.org/wiki/Regular_expression
The concept arose in the 1950s when the American mathematician Stephen Cole Kleene formalized the description of a regular language.
関連(本人)
PythonのData model(データモデル)のThe standard type hierarchy(標準型の階層)
pythonをストレスなく使う!(ExpressionとStatement)
余談
以下の記事で、日本語と英語の対応に関して少し理解が深まった。![]()
argumentの記載あり。
英語辞書。記載に関するとても重要な話。 (いろんな人に教えてあげて下さい)
今後
適宜、追記します。
誤りなどコメントあればお願いします。
見て頂いた方に役立つためには、もう少し、記載に工夫がいることは認識しています。