Skip to content

object.__new__()の説明における誤訳 #1022

Description

@reccfw25

概要

object.__new__(cls[, ...])の説明の第一段落の以下の文:

残りの引数はオブジェクトのコンストラクタの式 (クラスの呼び出し文) に渡されます。

は正しくは「コンストラクタの式に渡された引数が__new__()の残りの引数になる」ということだと思われます。

問題のある箇所 (URLで指定すること)

https://docs.python.org/ja/3/reference/datamodel.html#object.%5F%5Fnew%5F%5F

問題の詳細

対応する原文は

https://docs.python.org/3/reference/datamodel.html#object.%5F%5Fnew%5F%5F

The remaining arguments are those passed to the object constructor expression (the call to the class).

です。同ページの3.2.8.8. Classesで説明されているようにクラスの呼び出しに渡された引数は__new__()に渡されますが、概要で引用した日本語訳では逆になっています。

修正案

続く object.__init__(self[, ...])の説明の第一段落で原文の

The arguments are those passed to the class constructor expression.

引数はクラスのコンストラクタ式に渡したものです。

と訳しているのでそれに合わせて以下のようにすればいいかと思います。

残りの引数はオブジェクトのコンストラクタの式 (クラスの呼び出し文) に渡したものです。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions