Re: Rich Comparisons Gotcha

2008-12-10 Thread Rasmus Fogh
Rhodri James wrote: > On Mon, 08 Dec 2008 14:24:59 -0000, Rasmus Fogh wrote: >> On the minus side there would be the difference between >> '__equal__' and '__eq__' to confuse people. > This is a very big minus. It would be far better to spell __equal__ i

Re: Rich Comparisons Gotcha

2008-12-10 Thread Rasmus Fogh
ore robust solution). Still, why not get rid of this wart, if we can find a way? --- Dr. Rasmus H. Fogh Email: [EMAIL PROTECTED] Dept. of Biochemistry, University of Cambridge, 80 Tennis Court Road, Cambridge CB2 1GA, UK. FAX (01223)766002 -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Mark Dickinson wrote: > On Dec 8, 2:24 pm, Rasmus Fogh <[EMAIL PROTECTED]> wrote: >> So, I would much prefer a language change. I am not competent to even >> propose one properly, but I'll try. > I don't see any technical problems in what you propose: a

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Steven DAprano wrote: > On Mon, 08 Dec 2008 14:24:59 +0000, Rasmus Fogh wrote: snip >> What might be a sensible behaviour (unlike your proposed wrapper) Sorry 1) I was rude, 2) I thanked TJR for your wrapper class proposal in a later mail. It is yours. > What do you dislike abou

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rasmus Fogh
Steven DAprano wrote: > On Mon, 08 Dec 2008 14:24:59 +0000, Rasmus Fogh wrote: >> For my personal problem I could indeed wrap all objects in a wrapper >> with whatever 'correct' behaviour I want (thanks, TJR). It does seem a >> bit much, though, just to get cod

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rasmus Fogh
Rober Kern wrote: >James Stroud wrote: >> Steven D'Aprano wrote: >>> On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: >>>> Rasmus Fogh wrote: >>>>>>>> ll1 = [y,1] >>>>>>>> y in ll1 >>>>>

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
> On Sun, 07 Dec 2008 13:03:43 +0000, Rasmus Fogh wrote: >> Jamed Stroud Wrote: > ... >>> Second, consider that any value in python also evaluates to a truth >>> value in boolean context. > But bool(x) can fail too. So not every object in Python can be > inte

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
Jamed Stroud Wrote: > Rasmus Fogh wrote: >> Dear All, >> For the first time I have come across a Python feature that seems >> completely wrong. After the introduction of rich comparisons, equality >> comparison does not have to return a truth value, and may indeed r

Re: Rich Comparisons Gotcha

2008-12-07 Thread Rasmus Fogh
Robert Kern Wrote: >Terry Reedy wrote: >> Rasmus Fogh wrote: >>> Personally I would like to get these [EMAIL PROTECTED]&* misfeatures >>> removed, >> >> What you are calling a misfeature is an absence, not a presence that >> can be removed. >

Rich Comparisons Gotcha

2008-12-06 Thread Rasmus Fogh
better reason? 2) If I want to write generic code, can I somehow work around the fact that if foo == bar: or foo in alist does not work for arbitrary objects? Yours, Rasmus Some details: CCPN has a table display class that maintains a list of arbitrary objects, one per line in the

Re: Plotting 3d points

2008-02-11 Thread Rasmus Kjeldsen
A google search yields nothing useable. Rasmus Kjeldsen -- http://mail.python.org/mailman/listinfo/python-list

Plotting 3d points

2008-02-10 Thread Rasmus Kjeldsen
xamples i've seen of mlab to make any sense (the importing the module part, that is!). Rasmus Kjedlsen -- http://mail.python.org/mailman/listinfo/python-list

Re: opposite of zip()?

2007-12-15 Thread rasmus
On Dec 15, 4:45 am, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi folks, > > > Thanks, for all the help. I tried running the various options, and > > here is what I found: > > > from array import array > > from time import time > > > def f1(recs, cols): > > for r in r

Re: GLE-like python package

2007-10-14 Thread rasmus
sier than GLE (naturally) but since it is > python I'm willing to bite that bullet. > > Thanks :) > /W In case you're interested in making interactive visualizations, you might want to look at my own python package SUMMON: http://people.csail.mit.edu/rasmus/summon/index.shtml Matt -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I get the current path of my python file that is currently running.

2007-08-23 Thread rasmus
On Aug 23, 3:33 am, Arnau Sanchez <[EMAIL PROTECTED]> wrote: > Lamonte Harris escribió: > > > Say I start i click on a python file on my desktop, how could I return > > the path of the current python file thats running? > > http://docs.python.org/lib/module-sys.html Try this: import sys import os

profiling a C++ python extension

2007-07-10 Thread rasmus
I have used gprof to profile stand alone C++ programs. I am also aware of pure python profilers. However, is there a way to get profile information on my C++ functions when they are compiled in a shared library (python extension module) and called from python. From what I can tell, gmon.out will

SUMMON - Rapid prototyping of 2D visualizations

2007-04-05 Thread matt . rasmus
these features in an extension module for python called SUMMON which I have made freely available on my website for anyone who is interested <http://people.csail.mit.edu/ rasmus/summon/index.shtml>. Although, there are many visualization frameworks, I believe SUMMON provides a fairly