>>>>> "Panos Laganakos" <[EMAIL PROTECTED]> (PL) wrote:

>PL> Thanks Ben.
>PL> What does it mean that they're statically bound?

It means that the default values are evaluated at definition time. At that
time there isn't a variable 'self' defined. It would only work if the
defaults would be evaluated at the time the method is called, but that's
not how Python works.

>PL> It seems weird that I'm not able to access variables in the class
>PL> namespace even though these attributes come into existance after class
>PL> instantiation.

What do you mean 'variables in the class namespace'? Which variable is in
the class namespace? Please note that you can access variables in the class
namespace:

class MyClass:

    a = 10
    b = 20
    
    def my_method(self, param1=a, param2=b):
        print param1, param2

-- 
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: [EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to