Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd259bf

Browse files
committed
Merge: #29005: clarify terminology in tutorial 'method' discussion.
2 parents 59b0eb5 + 4ec1590 commit cd259bf

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Doc/tutorial/classes.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,11 @@ Surely Python raises an exception when a function that requires an argument is
374374
called without any --- even if the argument isn't actually used...
375375

376376
Actually, you may have guessed the answer: the special thing about methods is
377-
that the object is passed as the first argument of the function. In our
377+
that the instance object is passed as the first argument of the function. In our
378378
example, the call ``x.f()`` is exactly equivalent to ``MyClass.f(x)``. In
379379
general, calling a method with a list of *n* arguments is equivalent to calling
380380
the corresponding function with an argument list that is created by inserting
381-
the method's object before the first argument.
381+
the method's instance object before the first argument.
382382

383383
If you still don't understand how methods work, a look at the implementation can
384384
perhaps clarify matters. When an instance attribute is referenced that isn't a
@@ -906,4 +906,3 @@ Examples::
906906
namespace; the name :attr:`~object.__dict__` is an attribute but not a global name.
907907
Obviously, using this violates the abstraction of namespace implementation, and
908908
should be restricted to things like post-mortem debuggers.
909-

0 commit comments

Comments
 (0)