[Bf-python] API refactoring considerations
Stephen Swaney
sswaney at centurytel.net
Wed May 31 17:16:15 CEST 2006
On Tue, May 30, 2006 at 06:22:35PM -0700, Ken Hughes wrote:
> (1).. maybe
> it's time to start having attribute getters returning boolean when they
> really are booleans?
Another vote for returning booleans. Consider it an example of the
"be liberal in what you accept and conservative in what you return"
principle
> (2) [clamp values or thow an exception]
dislaimer: I'm still drinking coffee this morning, so consider
this part as being without actual conscious thought.
I kind of like the idea of clamping inputs. Throwing an
exception seems rather harsh. A similar phyisical
analogue would be like cranking the stereo up to 11. As
long as you don't torque the knob to hard, you get MAX_VALUE.
It might be nice for clamped setters to return the actual
value just in case the script actually cares. Just a thought.
/me promises to look at the bitfield wiki stuff later
this evening.
--
Stephen Swaney
sswaney at centurytel.net
More information about the Bf-python
mailing list