On 21 Dec 2006 09:44:48 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote:
> "George Sakkis" <[EMAIL PROTECTED]> wrote:
>
> @expr
> def fn(...): ...
>
> is exactly equivalent to:
>
> def fn(...): ...
> fn = (expr)(fn)
>

ok i did my homework reading about decorators
http://www.python.org/doc/2.4.4/whatsnew/node6.html

could it be the example above needs to be like

@expr
def fn(...): ...

is exactly equivalent to:

def fn(...): ...
fn = expr(fn)

> > oh and self stands more or less for private method right ?
>
> if you have to ask that question about 'self' you really do need to read
> some introductory texts on Python.
>
> Methods get passed their instance as their first parameter (usually this is
> implicit in the call, but it is always explicitly shown in the method) and
> self is simply the conventional name. Many other languages use 'this'
> instead of self and make the passing of 'this' implicit inside the method
> as well as outside. There are good reasons why it is explicit in Python,
> but just remember that the first parameter a method receives is always the
> instance and you won't go far wrong.

in all the things i every read about self i end up with blablabla
scoping blabla blabla self:: blablabla public static methods blablabla
:)

So when reading 'self' is the same as 'this' it was worth asking the
question for confusion sake :)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to