Re: attributes, properties, and accessors -- philosophy

2009-12-09 Thread Trevor Dorsey
Back to the subject of good tools. Use an IDE that's intended for python. We started using WingIDE because it had an inline debugger and came with all the nice things like autocomplete etc that things like eclipse or visual studio have. On Wed, Nov 25, 2009 at 8:46 AM, Bruno Desthuilliers

Re: attributes, properties, and accessors -- philosophy

2009-11-25 Thread Bruno Desthuilliers
Ethan Furman a écrit : Let's head towards murkier waters (at least murkier to me -- hopefully they can be easily clarified): some of the attributes are read-only, such as record count; others are not directly exposed, but still settable, such as table version; and still others require a

Re: attributes, properties, and accessors -- philosophy

2009-11-25 Thread Bruno Desthuilliers
Ethan Furman a écrit : (snip) Okay, I'll go back and switch all my attributes *back* to attributes -- and properties will be much nicer than my original implementation (using __getattr__ and __setattr__). It will also be faster FWIW. -- http://mail.python.org/mailman/listinfo/python-list

Re: attributes, properties, and accessors -- philosophy

2009-11-25 Thread Ethan Furman
Bruno Desthuilliers wrote: Ethan Furman a écrit : Let's head towards murkier waters (at least murkier to me -- hopefully they can be easily clarified): some of the attributes are read-only, such as record count; others are not directly exposed, but still settable, such as table version;

Re: attributes, properties, and accessors -- philosophy

2009-11-25 Thread Bruno Desthuilliers
Ethan Furman a écrit : Very helpful, thank you. Hopefully my brain will be up to the descriptor protocol this time... the last couple times were, um, less than successful. :) Well, it's quite simple in fact. Most of the magic happens in object.__getattribute__ and object.__setattr__.

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Bruno Desthuilliers
Ethan Furman a écrit : The problem I have with properties is my typing. I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or missing an underscore -- non-obvious things when bug-hunting), so now I have an extra attribute which of course has zero effect

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Ethan Furman
Bruno Desthuilliers wrote: Ethan Furman a écrit : The problem I have with properties is my typing. I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or missing an underscore -- non-obvious things when bug-hunting), so now I have an extra attribute

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Chris Rebert
On Tue, Nov 24, 2009 at 9:39 AM, Ethan Furman et...@stoneleaf.us wrote: Bruno Desthuilliers wrote: Ethan Furman a écrit : The problem I have with properties is my typing.  I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or missing an underscore --

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Lie Ryan
Ethan Furman wrote: Good tools to know about, and a consistent naming pattern also makes life easier (which I have since done ;). Let's head towards murkier waters (at least murkier to me -- hopefully they can be easily clarified): some of the attributes are read-only, such as record

Re: attributes, properties, and accessors -- philosophy

2009-11-24 Thread Ethan Furman
Chris Rebert wrote: On Tue, Nov 24, 2009 at 9:39 AM, Ethan Furman et...@stoneleaf.us wrote: Bruno Desthuilliers wrote: Ethan Furman a écrit : The problem I have with properties is my typing. I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or

attributes, properties, and accessors -- philosophy

2009-11-23 Thread Ethan Furman
The problem I have with properties is my typing. I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or missing an underscore -- non-obvious things when bug-hunting), so now I have an extra attribute which of course has zero effect on what I'm trying to do

Re: attributes, properties, and accessors -- philosophy

2009-11-23 Thread Chris Rebert
On Mon, Nov 23, 2009 at 10:52 AM, Ethan Furman et...@stoneleaf.us wrote: The problem I have with properties is my typing.  I'll end up assigning to an attribute, but get the spelling slightly wrong (capitalized, or missing an underscore -- non-obvious things when bug-hunting), so now I have an