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


Groups > comp.lang.python > #80943

Re: How modules work in Python

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'method.': 0.07; 'reason,': 0.07; 'function,': 0.09; 'instance.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:modules': 0.09; 'subject:How': 0.10; 'finney': 0.16; 'quoted': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'header:User-Agent:1': 0.23; 'questions:': 0.24; '(or': 0.24; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'posting': 0.31; 'url:wiki': 0.31; 'ordinary': 0.31; 'python).': 0.31; 'url:wikipedia': 0.31; 'writes:': 0.31; 'open': 0.33; 'but': 0.35; 'there': 0.35; 'material': 0.36; 'method': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'ben': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'soon': 0.63; 'our': 0.64; 'more': 0.64; 'skip:\xe2 10': 0.65; 'abandon': 0.84; 'received:125': 0.84; 'responses': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: How modules work in Python
Date Mon, 17 Nov 2014 12:23:35 +1100
References <CAA+hu4WstWquKEJ3C4AnWqbcNb5Y55G+xmywzF1hhEei9NQi=A@mail.gmail.com> <m4b92h$2dj$1@ger.gmane.org> <CAA+hu4UYRgU85LSQu_G2XU3sPhe-DdBH2S2bZH9Kd6CACLMRUA@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock sha1:1OQjvF2f/0k/xgfVcAi7uqylcLQ=
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15932.1416187505.18130.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416187505 news.xs4all.nl 2831 [2001:888:2000:d::a6]:34724
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80943

Show key headers only | 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