Re: [Python-Dev] operator precedence of __eq__, __ne__, etc, if both object have implementations

2009-09-22 Thread Jared Flatow
This might help: http://mail.python.org/pipermail/python-dev/2008-June/080111.html Here is the most relevant part (quoting Guido): > Does it help if I tell you that for "x y" we always try > x.__binop__(y) before trying y.__reverse_binop__(x), *except* in the > case where y is an instance of a

[Python-Dev] PySequence_Concat for dicts

2008-01-11 Thread Jared Flatow
Hi all, I am fairly new to the Python community so please forgive me (and correct me) if I am going about this wrong. I think it would be convenient and pythonic if dict objects implemented the PySequence_Concat method. I see there was once a short-lived discussion about this here: http://

Re: [Python-Dev] PySequence_Concat for dicts

2008-01-11 Thread Jared Flatow
On Jan 11, 2008, at 6:45 PM, Raymond Hettinger wrote: > IMO, the chainmap() recipe on ASPN is a much better solution since > it doesn't create a third dictionary with the all the attendant > allocation and copying effort. I wasn't suggesting that the result of concatenation would be a chaine

Re: [Python-Dev] PySequence_Concat for dicts

2008-01-12 Thread Jared Flatow
> On Jan 11, 2008 5:21 PM, Raymond Hettinger <[EMAIL PROTECTED]> wrote: >> When does it come-up that you want a third summed dict >> while keeping the two originals around unchanged? Does >> it matter that the addition is non-commutative? Would >> a + b + c produce an intermediate a/b combo and t

Re: [Python-Dev] PySequence_Concat for dicts

2008-01-13 Thread Jared Flatow
On Jan 12, 2008, at 5:32 PM, Raymond Hettinger wrote: > Not natural, just inefficient and cute. Also, there was no answer > to the question about use cases. Fair enough. I will present some use cases below. > AFAICT, this feature has never been requested. The closest was a > feature request f

Re: [Python-Dev] trunc()

2008-01-25 Thread Jared Flatow
On Jan 25, 2008, at 1:22 PM, Raymond Hettinger wrote: > I wouldn't fret about this too much. Intrepreting int(f) as > meaning truncate has a *long* history in *many* programming > languages. It is a specious argument int(f) is ambiguous. > No one thinks it means ceil(f). Not that I think my opi

Re: [Python-Dev] Any Emacs tips for core developers?

2008-02-04 Thread Jared Flatow
On Feb 4, 2008, at 11:12 AM, [EMAIL PROTECTED] wrote: > Personally, I have been using GNU Emacs's new python mode since I > discovered it, and I've never encountered any of the bugs you just > described. (Perhaps you are describing bugs that arise from trying to > use it with XEmacs?) I'm not u

Re: [Python-Dev] Any Emacs tips for core developers?

2008-02-04 Thread Jared Flatow
I am not a core developer but I use emacs exclusively for development so you may find this useful. On Feb 3, 2008, at 6:53 PM, [EMAIL PROTECTED] wrote: > I am also the guy more-or-less responsible for syncing python-mode > with the > version delivered as part of the XEmacs packages (last synce

Re: [Python-Dev] Problems with the new super()

2008-05-01 Thread Jared Flatow
On May 1, 2008, at 9:21 PM, Greg Ewing wrote: If the classes being mixed clash or overlap in functionality somehow, the inheriting class needs to override all of the clashing methods and properties and resolve matters by delegating to one or another of the inherited classes (using explicit inhe

[Python-Dev] Assumed reflexivity of rich comparison operators

2008-06-06 Thread Jared Flatow
Hi all, PEP 207 (http://www.python.org/dev/peps/pep-0207/) states in the fourth clause of the proposed resolutions to concerns: "The reflexivity rules *are* assumed by Python. Thus, the interpreter may swap y>x with x=x with x<=y, and may swap the arguments of x==y and x!=y." However,

Re: [Python-Dev] Assumed reflexivity of rich comparison operators

2008-06-06 Thread Jared Flatow
On Jun 6, 2008, at 3:24 PM, Guido van Rossum wrote: On Fri, Jun 6, 2008 at 1:10 PM, Jared Flatow <[EMAIL PROTECTED]> wrote: PEP 207 (http://www.python.org/dev/peps/pep-0207/) states in the fourth clause of the proposed resolutions to concerns: "The reflexivity rules *are* assume