Re: python newbie
- From: "Hendrik van Rooyen" <mail@xxxxxxxxxxxxxxx>
- Date: Sat, 3 Nov 2007 08:36:24 +0200
"Bruno Desthuilliers" wrote:
functions are *not* methods of their module.
Now I am confused - if I write:
result = foo.bar(param)
Then if foo is a class, we probably all agree that bar is
a method of foo.
But the same syntax would work if I had imported some
module as foo.
So what's the difference ? Why can't bar be called a method
of foo, or is it merely a convention that classes have
methods and modules have functions?
Note that I am purposely refraining from mentioning a module
that has a class that has a method.
- Hendrik
.
- Follow-Ups:
- Re: python newbie
- From: Bruno Desthuilliers
- Re: python newbie
- From: Bjoern Schliessmann
- Re: python newbie
- From: Steven D'Aprano
- Re: python newbie
- References:
- python newbie
- From: Jim Hendricks
- Re: python newbie
- From: Bjoern Schliessmann
- Re: python newbie
- From: Bruno Desthuilliers
- python newbie
- Prev by Date: Re: how to do the mapping btw numpy arrayvalues and matrix columns
- Next by Date: Can local function access local variables in main program?
- Previous by thread: Re: python newbie
- Next by thread: Re: python newbie
- Index(es):
Relevant Pages
|
|