[EMAIL PROTECTED] wrote:
> Yes. I want to have only one class variable called c and a and b are
> required as temporary variables to calculate the value for c.
>
> I just found one way:
> class Test:
>     a = 1
>     b = 2
>     c = a + b
>     del a,b

Or even...

a = 1
b = 2
class Test:
    c = a + b

Or even the apparently nonsensical...

a = 1
b = 2
c = a + b
class Test:
    c = c

Insert del statements to remove module globals where appropriate.

Paul

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to