Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80943

Re: How modules work in Python

From Ben Finney <ben+python@benfinney.id.au>
Subject Re: How modules work in Python
Date 2014-11-17 12:23 +1100
References <CAA+hu4WstWquKEJ3C4AnWqbcNb5Y55G+xmywzF1hhEei9NQi=A@mail.gmail.com> <m4b92h$2dj$1@ger.gmane.org> <CAA+hu4UYRgU85LSQu_G2XU3sPhe-DdBH2S2bZH9Kd6CACLMRUA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15932.1416187505.18130.python-list@python.org> (permalink)

Show all headers | View raw


Abdul Abdul <abdul.sw84@gmail.com> writes:

> Thanks for your nice explanation. For your answer on one of my
> questions:

(Please use “interleaved” posting style, for showing quoted material and
your responses <URL:https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.)

> * Modules don't have methods. open is an ordinary function in the module.*
>
> Isn't "method" and "function" used interchangeably?

No (or more accurately: if someone does use those interchangeably,
they're not correctly describing Python).

A method is always a function, but a function is not always a method.

A method is a function bound to a specific object instance.

-- 
 \      “As soon as we abandon our own reason, and are content to rely |
  `\       upon authority, there is no end to our troubles.” —Bertrand |
_o__)                                Russell, _Unpopular Essays_, 1950 |
Ben Finney

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How modules work in Python Ben Finney <ben+python@benfinney.id.au> - 2014-11-17 12:23 +1100

csiph-web