Re: [Python-3000] exception-swallowing behaviour of hasattr

2008-01-22 Thread Guido van Rossum
IMO (1) or (2) are both acceptable, but I'd prefer (2): swallow 'Exception'. There's a reason why hasattr() is different from getattr() with a default value; it's too early for me to explain it clearly, but I know it was discussed and argued at length when hasattr() was introduced. I don't see why

Re: [Python-3000] [Python-Dev] inst_persistent_id

2008-01-22 Thread Jim Fulton
On Jan 20, 2008, at 10:39 PM, Alexandre Vassalotti wrote: > On Jan 20, 2008 4:14 PM, Jim Fulton <[EMAIL PROTECTED]> wrote: >> >> On Jan 12, 2008, at 7:33 PM, Alexandre Vassalotti wrote: >>> By the way, you might be interested to look at my work on pickle [1] >>> for Python 3K. As part of last yea

Re: [Python-3000] exception-swallowing behaviour of hasattr

2008-01-22 Thread Guido van Rossum
On Jan 22, 2008 9:31 AM, Chris Mellon <[EMAIL PROTECTED]> wrote: > On Jan 22, 2008 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > IMO (1) or (2) are both acceptable, but I'd prefer (2): swallow > > 'Exception'. There's a reason why hasattr() is different from > > getattr() with a default

Re: [Python-3000] exception-swallowing behaviour of hasattr

2008-01-22 Thread Chris Mellon
On Jan 22, 2008 11:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On Jan 22, 2008 9:31 AM, Chris Mellon <[EMAIL PROTECTED]> wrote: > > On Jan 22, 2008 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > IMO (1) or (2) are both acceptable, but I'd prefer (2): swallow > > > 'Exception'

Re: [Python-3000] exception-swallowing behaviour of hasattr

2008-01-22 Thread Chris Mellon
On Jan 22, 2008 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > IMO (1) or (2) are both acceptable, but I'd prefer (2): swallow > 'Exception'. There's a reason why hasattr() is different from > getattr() with a default value; it's too early for me to explain it > clearly, but I know it was d

Re: [Python-3000] exception-swallowing behaviour of hasattr

2008-01-22 Thread Guido van Rossum
On Jan 22, 2008 9:39 AM, Chris Mellon <[EMAIL PROTECTED]> wrote: > > On Jan 22, 2008 11:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > On Jan 22, 2008 9:31 AM, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > On Jan 22, 2008 9:36 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > > > IMO

[Python-3000] Fwd: [Python-Dev] misbehaving __contains__

2008-01-22 Thread tomer filiba
i can work on a patch, but before i start, i want to make sure it's accepted. the change will require sq_contains to return a PyObject, as well as some minor tweaks to cmp_outcome(). -tomer -- Forwarded message -- From: Guido van Rossum <[EMAIL PROTECTED]> Date: Jan 22, 2008 9:55

Re: [Python-3000] Fwd: [Python-Dev] misbehaving __contains__

2008-01-22 Thread tomer filiba
On Jan 22, 2008 10:48 PM, Nicko van Someren <[EMAIL PROTECTED]> wrote: > I don't know if your patch will be accepted but two salient questions > you should address are: > a) Will the change break much existing code? > b) Will the change substantially impact performance? well, i wil

Re: [Python-3000] [Python-Dev] misbehaving __contains__

2008-01-22 Thread Guido van Rossum
I can't promise a patch is accepted before I see it. :-) But the idea is sound, so don't worry about it being rejected on the basis of being an undesirable feature. --Guido On Jan 22, 2008 12:36 PM, tomer filiba <[EMAIL PROTECTED]> wrote: > i can work on a patch, but before i start, i want to ma

Re: [Python-3000] Fwd: [Python-Dev] misbehaving __contains__

2008-01-22 Thread Nicko van Someren
On 22 Jan 2008, at 20:36, tomer filiba wrote: > i can work on a patch, but before i start, i want to make sure it's > accepted. the change will require sq_contains to return a PyObject, > as well as some minor tweaks to cmp_outcome(). I don't know if your patch will be accepted but two salient qu

[Python-3000] Ellipsis Literal

2008-01-22 Thread Raymond Hettinger
I missed the conversation on this one. Was there a use case or a reason to add this? I ask because the spelling has an unfortunate overlap with the sys.ps2 prompt: >>> def f(x): ... return x+1 I don't know if this is a problem. Just thought I would bring it up. Raymond

Re: [Python-3000] Ellipsis Literal

2008-01-22 Thread Robert Kern
Raymond Hettinger wrote: > I missed the conversation on this one. > Was there a use case or a reason to add this? It was added for Numeric a long time ago. We use it in multidimensional indices to specify slice(None, None, None) for all of the omitted dimensions. For example: In [25]: from num