Skip to content

[Typo]: 设计和历史常见问题中“方法”误译为“方式” #378

Closed
@xaondxmzrd

Description

@xaondxmzrd

Python Version

3.13

Docs Page

https://docs.python.org/zh-cn/3/faq/design.html#why-self

Original Translation

其次,这意味着当要显式引用或从特定类调用该方法时无须特殊语法。 在 C++ 中,如果你想要使用在派生类中被重写的基类方法,你必须使用 :: 运算符 -- 在 Python 中你可以写成 baseclass.methodname(self, )。 这特别适用于 init() 方法,并且也适用于派生类方法想要扩展同名的基类方式因而必须以某种方式调用基类方法的情况。

Original Docs Paragraph

Second, it means that no special syntax is necessary if you want to explicitly reference or call the method from a particular class. In C++, if you want to use a method from a base class which is overridden in a derived class, you have to use the :: operator – in Python you can write baseclass.methodname(self, ). This is particularly useful for init() methods, and in general in cases where a derived class method wants to extend the base class method of the same name and thus has to call the base class method somehow.

Suggested Fix

“基类方式”应为“基类方法”

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions