Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Raymond Hettinger
[MvL] > 1. For 2.5.1, rewrite slot_nb_inplace_power to raise an exception > if the third argument is not None, and then invoke __ipow__ with only one > argument. [Raymond] >> Why would you change Py2.5? There is no bug here. [MvL] > There is: slot_nb_inplace has the signature > > st

Re: [Python-Dev] Adding timeout option to httplib...connect()

2007-02-08 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > I recently needed to access an HTTP URL with a timeout. I ended up > monkey-patching httplib.HTTPConnection so that the connect() method > has an optional second paramer, timeout, defaulting to None; if not > None, a call to settimeout() is added

Re: [Python-Dev] Adding timeout option to httplib...connect()

2007-02-08 Thread Raymond Hettinger
[GvR] >I recently needed to access an HTTP URL with a timeout. I ended up > monkey-patching httplib.HTTPConnection so that the connect() method > has an optional second paramer, timeout, defaulting to None; if not > None, a call to settimeout() is added right after successful creation > of the sock

[Python-Dev] Adding timeout option to httplib...connect()

2007-02-08 Thread Guido van Rossum
I recently needed to access an HTTP URL with a timeout. I ended up monkey-patching httplib.HTTPConnection so that the connect() method has an optional second paramer, timeout, defaulting to None; if not None, a call to settimeout() is added right after successful creation of the socket. Does anybo

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Greg Ewing
Martin v. Löwis wrote: > It is the implementation of > > foo **= bar > > (and that's its only use), so it ought to be binary. Maybe it's so that a type can plug the same implementation into both nb_pow and nb_inplace_pow. Although the same effect could be achieved by just leaving nb_inplace_pow

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Brett Cannon
On 2/8/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > #1653736 reports that slot_nb_inplace_power has the wrong > type: it should be a ternary function, but only is a binary. > The proposed change is to make it ternary, and to invoke __ipow__ > with three arguments. > > In researching this, I c

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: 1. For 2.5.1, rewrite slot_nb_inplace_power to raise an exception if the third argument is not None, and then invoke __ipow__ with only one argument. > > Why would you change Py2.5? There is no bug here. There is: slot_nb_inplace has the signature stat

Re: [Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread python
[MvL] >>> So here is my proposed change: >>> >>> 1. For 2.5.1, rewrite slot_nb_inplace_power to raise an exception >>> if the third argument is not None, and then invoke __ipow__ with only one >>> argument. Why would you change Py2.5? There is no bug here. Raymond

[Python-Dev] Why is nb_inplace_power ternary?

2007-02-08 Thread Martin v. Löwis
#1653736 reports that slot_nb_inplace_power has the wrong type: it should be a ternary function, but only is a binary. The proposed change is to make it ternary, and to invoke __ipow__ with three arguments. In researching this, I came to wonder why nb_inplace_power is ternary in the first place. I