Tangram for Python?
jll at skynet.be
Wed Mar 8 18:41:14 CET 2000
> > 1) direct attribute access, like in Perl or Smalltalk (#instVarAt:)
> > [for orthogonality]
> Do you mean simply the ability to refer to obj.attr, instead of going
> through a get_attr() accessor function? If that's correct, then yes,
> Python has that.
> > 2) interception of attribute access, à la Perl's tie()
> > [for orthogonal relationships-on-demand]
> Yes; you can define a __getattr__(self, attrname) method for a class,
> See http://www.python.org/doc/ref/attribute-access.html for the
Can that be done from outside the class? For example, is it possible
for a module like Tangram to add these attribute methods on the fly?
> > 5) operator overloading
> > [for a 'natural' way of building where-clauses]
> Yes; again, you can define magically-named methods such as __add__,
> __sub__, __mul__, etc. to overload various operations. (Though in all
> honesty, from reading the Tangram docs I thought the use of
> overloading to build where-clauses was a bit opaque and confusing.)
In all honesty, I had a harder time documenting Tangram that actually
building it...well, almost ;-)
Consider the alternative: building where-clauses via function
calls. It's very verbose. Compare TopLINK for Smalltalk and its Java
Python does look like a good platform. But I don't have much time
right now for a free (as in gratis) project of that envergure.
I was wondering, is it imaginable that people or companies from the
Python community would sponsor a Python port? Via cosource.com? For
startes, how many are interested in an object-relational mapper à la
VLR Jean-Louis Leroy
More information about the Python-list