Re: [Python-3000] Pre-peps on raise and except changes

2007-02-12 Thread Nick Coghlan
Guido van Rossum wrote: > Somehow it seems that exceptions keep getting permission to violate > the rules... (E.g. the insistence on a fixed base class is also > considered unpythonic in other contexts.) Maybe it's because they're > "exceptions" ? :-) > > Anyway, I believe there's a use case for r

Re: [Python-3000] how should we handle changes to the C API?

2007-02-12 Thread Brett Cannon
On 2/11/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Brett Cannon schrieb: > > Right, but I wanted to be able to raise a warning. If that warning is > > supposed to be treated as an exception the caller needs to let that > > propagate. RIght now PyErr_GivenExceptionMatches() can in no way l

Re: [Python-3000] how should we handle changes to the C API?

2007-02-12 Thread Guido van Rossum
But I only want the latter in Py3k, and I don't mind using a different API there, even potentially a separate check after evaluating 'E' but before checking whether it matches. I think it's fine not to catch this in 2.6; after all it's a bug anyway so we're not expecting many occurrences. I don't

Re: [Python-3000] Pre-peps on raise and except changes

2007-02-12 Thread Greg Ewing
Nick Coghlan wrote: > Guido van Rossum wrote: > Someone else wrote: > > > raise FooException().with_traceback() > > Works for me. I don't like that somehow -- it looks too clever. Also it violates the general principle of mutating methods not returning things. I know Guido said he's willing to

Re: [Python-3000] how should we handle changes to the C API?

2007-02-12 Thread Martin v. Löwis
Brett Cannon schrieb: >> I'm unclear why you want to warn in PyErr_GivenExceptionMatches: >> shouldn't you rather warn when the exception is raised? >> > > Guido wants both so that you don't end up with useless values in the > 'except' clause. So yes, things are checked at the time of raising an