Steve Holden wrote:
> Fernando M. wrote:
>
>> Hi,
>>
>> i was just wondering about the need to put "self" as the first
>> parameter in every method a class has because, if it's always needed,
>> why the obligation to write it? couldn't it be implicit?
>>
>> Or is it a special reason for this being
In article <[EMAIL PROTECTED]>,
Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] (Aahz) (A) wrote:
>>
>> Any objection to swiping this for the FAQ? (Probably with some minor
>> edits.)
>
>No.
>The global/local stuff needs a bit more nuance (assignments in the method
>being the crite
Fernando M. wrote:
> Hi,
>
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
>
> Or is it a special reason for this being this way?
>
> Thanks.
Here'
In article <[EMAIL PROTECTED]>,
Peter Maas <[EMAIL PROTECTED]> wrote:
>Aahz schrieb:
>>>
>>>Because Python has no declarations there must be a different way to
>>>indicate in which category an identifier falls.
>[...]
>> Any objection to swiping this for the FAQ? (Probably with some minor
>> edit
Aahz schrieb:
>>Because Python has no declarations there must be a different way to
>>indicate in which category an identifier falls.
[...]
> Any objection to swiping this for the FAQ? (Probably with some minor
> edits.)
There is already a 'self' section (1.4.4) in the official Python FAQ.
Looks
Fernando M. schrieb:
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
>
> Or is it a special reason for this being this way?
See section 1.4.4 in http
>Explicit is better than implicit.
import sarcasm
def whatAboutMyImplicitModuleMethod()
--
http://mail.python.org/mailman/listinfo/python-list
> [EMAIL PROTECTED] (Aahz) (A) wrote:
>A> [posted & e-mailed]
>A> In article <[EMAIL PROTECTED]>,
>A> Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>>>
>>> There is.
>>> Inside a method there are 3 kinds of identifiers:
>>> - local ones e.g. parameters and local variables
>>> - global ones (ac
Aahz wrote:
> [posted & e-mailed]
> Any objection to swiping this for the FAQ? (Probably with some minor
> edits.)
I think it is missing the most important reason, that functions can act
as unbound methods.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
--
http://mai
Terry Hancock wrote:
> def __add__(a,b):
> return Vector((a.x+b.x), (a.y+b.y), (a.z+b.z))
>
> or something like that. I still have twinges of guilt about it,
> though, and I had to write a long note in the comments, apologizing
> and rationalizing a lot. ;-)
Assigning self to a could have m
On Tuesday 31 May 2005 11:52 am, Roy Smith wrote:
> Note that in languages like C++ where using "this->" is optional,
> people invent their own conventions for keeping local and instance
> variables distinct, like prepending m_ to member names (except that
> different people do it different ways, s
[posted & e-mailed]
In article <[EMAIL PROTECTED]>,
Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>
>There is.
>Inside a method there are 3 kinds of identifiers:
>- local ones e.g. parameters and local variables
>- global ones (actually module-level)
>- instance variables and methods
>
>Because Pyt
Skip Montanaro wrote:
> Simon> Of course, if you *don't* use 'self', you should expect an angly
> Simon> mob with pitchforks and torches outside your castle.
>
> I take it an "angly mob" is a large group of stick figures?
>
> Skip
Yep -- straw men.
--
http://mail.python.org/mailman/lis
Simon> Of course, if you *don't* use 'self', you should expect an angly
Simon> mob with pitchforks and torches outside your castle.
I take it an "angly mob" is a large group of stick figures?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
John Machin wrote:
> Simon Brunning wrote:
>> Of course, if you *don't* use 'self', you should expect an angly mob
>> with pitchforks and torches outside your castle.
>
> Wouldn't an angly mob be carrying fishing rods?
No, I rather think they'd be acutely obtuse, right?
--
http://mail.python.org
In article <[EMAIL PROTECTED]>,
Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote:
> John Machin wrote:
>
> >>Of course, if you *don't* use 'self', you should expect an angly mob
> >>with pitchforks and torches outside your castle.
> >>
> >
> > Wouldn't an angly mob be carrying fishing rods?
> >
>
John Machin wrote:
>>Of course, if you *don't* use 'self', you should expect an angly mob
>>with pitchforks and torches outside your castle.
>>
>
> Wouldn't an angly mob be carrying fishing rods?
>
Well, I thought they would be carrying pitchfolks and tolches.
--
http://mail.python.org/mailman
Simon Brunning wrote:
> On 31 May 2005 08:45:45 -0700, Fernando M.
> <[EMAIL PROTECTED]> wrote:
>
>>i was just wondering about the need to put "self" as the first
>>parameter in every method a class has because, if it's always needed,
>>why the obligation to write it?
>
>
> It doesn't need to be
> "Fernando M." <[EMAIL PROTECTED]> (FM) wrote:
>FM> Hi,
>FM> i was just wondering about the need to put "self" as the first
>FM> parameter in every method a class has because, if it's always needed,
>FM> why the obligation to write it? couldn't it be implicit?
>FM> Or is it a special reason
Fernando M. <[EMAIL PROTECTED]> wrote:
>i was just wondering about the need to put "self" as the first
>parameter in every method a class has because, if it's always needed,
>why the obligation to write it? couldn't it be implicit?
Didn't this exact question get asked just a few days ago?
Anyway,
Fernando M. wrote:
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
>
> Or is it a special reason for this being this way?
Because it's not always ne
On 31 May 2005 08:45:45 -0700, Fernando M.
<[EMAIL PROTECTED]> wrote:
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it?
It doesn't need to be 'self'. You could use 'this', or 's
Fernando M. wrote:
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
py> import this
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Ex
"Fernando M." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
>
> Or is it a speci
Fernando M. wrote:
> Hi,
>
> i was just wondering about the need to put "self" as the first
> parameter in every method a class has because, if it's always needed,
> why the obligation to write it? couldn't it be implicit?
>
> Or is it a special reason for this being this way?
>
> Thanks.
>
The
Hi,
i was just wondering about the need to put "self" as the first
parameter in every method a class has because, if it's always needed,
why the obligation to write it? couldn't it be implicit?
Or is it a special reason for this being this way?
Thanks.
--
http://mail.python.org/mailman/listinf
26 matches
Mail list logo