On Oct 17, 2005, at 8:17 PM, Paul McNett wrote:
What do you think of the original issue, that referencing
evt.attribute is, from the user perspective, like referencing
evt.Property, and therefore that we should consider capitalizing
the "Property"?
I don't see the significance. But then again, I've always
accessed these things via the EventData dict, since that's where Dabo
stores that information. I never even thought of accessing the
wxEvent stuff via __getattr__(); I didn't even know that was possible
until this discussion.
The main benefit to turning attributes into properties, whether
settable or not, is that properties can have docstrings while
attributes cannot.
OK, but how critical is it that we have a docstring for stuff
like 'altDown' and 'shiftDown'? You mean that if we simply list the
attributes available for a given event type, people won't know what
they mean, but that the docstrings will take care of that?
Again, I think that this is overkill.
I think that attributes have their place, but in the context of our
Dabo framework public API, I just don't think they belong. Sure,
users can set attributes and then use them (that is one of the key
features of Python versus Java, I agree), but attributes we expose
publicly should be props, IMO.
And then I guess that the next logical step is to not have any
function parameters that are not properties either, eh?
And the only reason this is coming up now is that we are now short-
circuiting EventData with __getattr__(), whereas before we were
getting the event data via keys in the dict.
Like I said, I was perfectly happy accessing the info I needed
via the EventData dict. I don't think that requiring this was so bad,
but hey, if we can make it simpler by letting people do evt.shiftDown
vs. evt.EventData["shiftDown"], then cool, go for it. But requiring
no attribute access at all? I think that that's rather draconian.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev