[XML-SIG] DOM API conundrum
Wed, 22 Nov 2000 17:13:36 -0700
> As I'm working on the API documentation, I'm finding that I'd like
> to document the nice, Pythonic interface and not the accessors. Is
> there anyone who would have problems if I deprecate the accessors in
> the documentation, and encourage direct access to the attributes? The
> only issue for DOM-over-CORBA that I can see is that a wrapper would
> be needed to call the _get_/_set_ methods on the surrogate when the
> attributes are accessed; just a little __getattr__/__setattr__ magic
> would be needed. Once the Document object is wrapped, the wrapper
> could handle wrapping of other objects from the tree automatically, so
> the infliction of wrappers would not need to permeate client code.
> Any objections to deprecating the _get_/_set_ methods?
The main reason to have these was to allow users avoid the performance hit of
__g/setattr__. I don't have a problem giving this up. It would be _really_
nice if Python had computed attributes (any PEPs out there?).
So +1 on deprecating function-based access in the Python/DOM binding. I never
use them anyway.
Uche Ogbuji Principal Consultant
email@example.com +1 303 583 9900 x 101
Fourthought, Inc. http://Fourthought.com
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python