PEP: Adding new operators for elementwise/objectwise operations

Huaiyu Zhu hzhu at users.sourceforge.net
Fri Sep 29 19:46:38 EDT 2000


On 28 Sep 2000 11:49:34 GMT, Kevin Jacobs <jacobs at darwin.epbi.cwru.edu> wrote:
>Tom Loredo <loredo at spacenet.tn.cornell.edu> wrote:
>> I am developing a statistical computing framework in Python, and may use
>> "~" in this already-accepted fashion; I would hate to see its meaning
>> "overloaded" this way.
>
>If possible, I suggest that you bring your statistical computing framework
>ideas to the newsgroup, or at least the very motivated subset of us who are
>thinking about or working on the same thing.  Personally, my dream is to
>have a Python based environment that will allow me to throw away SAS and
>S-Plus.

That would be very useful indeed.  Count me in the subset, please.
I had attempted to implement some of that functionality in Matlab sometime
ago. Of course Python would be a much better tool.

>
>-Kevin
>
>PS: Just to put in my vote, I am strongly for having the ability to 
>    overload ~ operators.  I too use BUGS, and while its a neat trick,
>    its ~ operator is pure syntactic sugar.  The PEP on new operators
>    addresses readability and maintainability, which are major issues
>    when an expression may have upwards of 10 infix operators (vs. 
>    BUGS which uses at most one ~ per statement).
>

Exactly.  I've just viewed the BUGS pages, and indeed the ~ operator is
binary and can only appears once per statement.  I think that using a
function or a method call would achieve similar effect.  If we really need
this kind of syntactic sugar we could overload a binary operator like a^b.,
for example.


Huaiyu

-- 
Huaiyu Zhu                       hzhu at users.sourceforge.net
Matrix for Python Project        http://MatPy.sourceforge.net 



More information about the Python-list mailing list