Discussion: new operators for numerical computation
John Lull
lull at acm.org
Fri Jul 21 08:24:31 EDT 2000
"Rainer Deyke" <root at rainerdeyke.com> wrote (with possible deletions):
> "John Lull" <lull at acm.org> wrote in message
> news:ueefns037mjarv63dqpbh52mmr1k6vvaop at 4ax.com...
> > This shouldn't be hard to parse. In fact, it might be a reasonable
> > foundation for class-specific operators:
> > A(.opName)B
> > would get executed as either
> > A.__opName__(B)
> > or
> > B.__ropName__(A)
> > or raise an exception as appropriate.
>
> This would allow constructs such as:
>
> A(.init)B
>
> In other words, it would turn all existing __magic__ functions into
> operators. Not a good idea IMO.
One could easily prevent that by having
A(.opName)B
invoke
A.___opName__(B)
instead of
A.__opName__(B)
or some such.
Clearly there's nothing to force use of the same naming convention for
these operator methods.
Regards,
John
More information about the Python-list
mailing list