Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Bruno Desthuilliers
Rafe a écrit : On Aug 16, 1:22 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Rafea écrit : Hi, I've been thinking in circles about these aspects of Pythonic design and I'm curious what everyone else is doing and thinks. There are 3 issues here: 1) 'Declaring' attributes There's nothing l

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Rafe
On Aug 16, 1:22 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Rafea écrit : > > > Hi, > > > I've been thinking in circles about these aspects of Pythonic design > > and I'm curious what everyone else is doing and thinks. There are 3 > > issues here: > > > 1) 'Declaring' attributes > > There'

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Bruno Desthuilliers
Fredrik Lundh a écrit : Eric Brunel wrote: To add to what others have already said, it is not only 'just extra work', it is also quite dangerous. See: class A(object): children = [] the OP is aware of that, of course: > I set anything that is constant but anything variable is set again

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Fredrik Lundh
Eric Brunel wrote: To add to what others have already said, it is not only 'just extra work', it is also quite dangerous. See: class A(object): children = [] the OP is aware of that, of course: > I set anything that is constant but anything variable is set again in > __init__() as long a

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-19 Thread Eric Brunel
On Fri, 15 Aug 2008 20:02:36 +0200, Rafe <[EMAIL PROTECTED]> wrote: [snip] 1) 'Declaring' attributes - I always felt it was good code practice to declare attributes in a section of the class namespace. I set anything that is constant but anything variable is set again in __init__(): Class A(obj

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Christian Heimes
Bruno Desthuilliers wrote: How often do you really need to override a property ? (hint : as far as I'm concerned, it never happened so far). Now you have two solutions : either redefine the whole property in the derived class, or, if you really intend your property to be overriden, provide a "t

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Bruno Desthuilliers
Rafe a écrit : Hi, I've been thinking in circles about these aspects of Pythonic design and I'm curious what everyone else is doing and thinks. There are 3 issues here: 1) 'Declaring' attributes There's nothing like "declaration" of variables/attributes/whatever in Python. - I always fel

Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Rafe
Hi, I've been thinking in circles about these aspects of Pythonic design and I'm curious what everyone else is doing and thinks. There are 3 issues here: 1) 'Declaring' attributes - I always felt it was good code practice to declare attributes in a section of the class namespace. I set anything