On 2007-05-03, Terry Reedy [EMAIL PROTECTED] wrote:
sturlamolden [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
|
| Python allows the binding behaviour to be defined for descriptors,
| using the __set__ and __get__ methods. I think it would be a major
| advantage if this could be
On May 3, 6:22 am, Charles Sanders [EMAIL PROTECTED]
wrote:
y = a*b+c*d # Returns a proxy object
x = y[4] # Computes x = a[4]*b[4] + c[4]*d[4]
v = y.eval() # Evaluates all elements, returning Xarray
z = ((a+b)*(c+d)).eval() # Also evaluates all
On 2007-05-03, sturlamolden [EMAIL PROTECTED] wrote:
On May 3, 6:22 am, Charles Sanders [EMAIL PROTECTED]
wrote:
y = a*b+c*d # Returns a proxy object
x = y[4] # Computes x = a[4]*b[4] + c[4]*d[4]
v = y.eval() # Evaluates all elements, returning Xarray
Python allows the binding behaviour to be defined for descriptors,
using the __set__ and __get__ methods. I think it would be a major
advantage if this could be generalized to any object, by allowing the
assignment operator (=) to be overloaded.
One particular use for this would be to implement
sturlamolden wrote:
Python allows the binding behaviour to be defined for descriptors,
using the __set__ and __get__ methods.
AFAIK, __getattribute__ calls them *explicitly*.
I think it would be a major
advantage if this could be generalized to any object, by allowing the
assignment
sturlamolden schrieb:
Python allows the binding behaviour to be defined for descriptors,
using the __set__ and __get__ methods. I think it would be a major
advantage if this could be generalized to any object, by allowing the
assignment operator (=) to be overloaded.
One particular use for
On May 2, 9:46 pm, Stargaming [EMAIL PROTECTED] wrote:
del tmp2
y = tmp3 # tmp3 gets evaluated as assignment is overloaded
To allow lazy evaluation, you need overloading of the assignment
operator?
No I don't. I could for example delay evaluation until some data from
y is requested, say
On May 2, 11:08 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
And AFAIK the general overhead of laziness versus eager evaluation does
not pay off - haskell is a tad slower than e.g. an ML dialect AFAIK.
In the numerical Python community there is already a prototype
compiler called 'numexpr'
sturlamolden [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
|
| Python allows the binding behaviour to be defined for descriptors,
| using the __set__ and __get__ methods. I think it would be a major
| advantage if this could be generalized to any object, by allowing the
| assignment
Diez B. Roggisch wrote:
I fail to see where laziness has anything to do with this.
In C++, this problem can be remedied with the so called
temporary base class idiom.
I have seen this referred to as lazy evaluation in C++,
so I suspect that Diez and Sturia are using Lazy evaluation
10 matches
Mail list logo