Michael Hudson [EMAIL PROTECTED] writes:
Michael Hudson [EMAIL PROTECTED] writes:
I hope to have a new patch (which makes PyExc_Exception new-style, but
allows arbitrary old-style classes as exceptions) soon. It may even
pass bits of make test :)
Done: http://www.python.org/sf/1104669
My design decision was to make Exception new-style. Things can be
raised if they are instances of old-style classes or instances of
Exception. If this meets with general agreement, I'd like to check
the above patch in.
I like it, but didn't you forget to mention that strings can still be
Guido van Rossum [EMAIL PROTECTED] writes:
My design decision was to make Exception new-style. Things can be
raised if they are instances of old-style classes or instances of
Exception. If this meets with general agreement, I'd like to check
the above patch in.
I like it, but didn't you
Martin v. Löwis [EMAIL PROTECTED] writes:
Guido van Rossum wrote:
a) Is Exception to be new-style?
Probably not in 2.5; Martin and others have suggested that this could
introduce instability for users' existing exception classes.
Really? I thought that was eventually decided to be a very small
Hi,
On Fri, Jan 14, 2005 at 07:20:31PM -0500, Jim Jewett wrote:
The base of the Exception hierarchy happens to be a classic class.
But why are they required to be classic?
For reference, PyPy doesn't have old-style classes at all so far, so we had to
come up with something about exceptions.
Hi Guido,
On Mon, Jan 17, 2005 at 07:27:33AM -0800, Guido van Rossum wrote:
That is stricter than classic Python though -- it allows the value to
be anything (and you get the value back unadorned in the except 's',
x: clause).
Thanks for the note !
Armin
Guido van Rossum [EMAIL PROTECTED] writes:
[Michael]
It would still be worth doing, IMHO.
Then let's do it. Care to resurrect your patch? (And yes, classic
classes should also be allowed for b/w compatibility.)
I found it and uploaded it here:
On Mon, 17 Jan 2005 11:35:53 -0500, Phillip J. Eby
[EMAIL PROTECTED] wrote:
At 04:06 PM 1/17/05 +, Michael Hudson wrote:
a) Is Exception to be new-style?
Probably not in 2.5; Martin and others have suggested that this could
introduce instability for users' existing exception classes.
At 10:16 AM 1/17/05 -0800, Guido van Rossum wrote:
On Mon, 17 Jan 2005 11:35:53 -0500, Phillip J. Eby
[EMAIL PROTECTED] wrote:
At 04:06 PM 1/17/05 +, Michael Hudson wrote:
a) Is Exception to be new-style?
Probably not in 2.5; Martin and others have suggested that this could
introduce
That would be much more reasonable if Exception itself was a new-style
class. As long as it isn't, you'd have to declare new-style classes
like this:
class MyError(Exception, object):
...
which is ugly.
I was thinking the use case was that you were having to add 'Exception',
not
Guido van Rossum wrote:
a) Is Exception to be new-style?
Probably not in 2.5; Martin and others have suggested that this could
introduce instability for users' existing exception classes.
Really? I thought that was eventually decided to be a very small amount of code.
I still think that only an
I still think that only an experiment could decide: somebody should
come up with a patch that does that, and we will see what breaks.
I still have the *feeling* that this has significant impact, but
I could not pin-point this to any specific problem I anticipate.
This sounds like a good
Guido van Rossum wrote:
The base of the Exception hierarchy happens to be a classic class.
But why are they required to be classic?
More to the point, is this a bug, a missing feature, or just a bug in
the documentation for not mentioning the restriction?
It's an unfortunate feature; it
On 2005 Jan 16, at 10:27, Martin v. Löwis wrote:
Simon Percivall wrote:
What would happen if Exception were made a new-style class, enforce
inheritance from Exception for all new-style exceptions, and allow all
old-style exceptions as before.
string exceptions would break.
Couldn't we just
Alex Martelli wrote:
What would happen if Exception were made a new-style class, enforce
inheritance from Exception for all new-style exceptions, and allow all
old-style exceptions as before.
string exceptions would break.
Couldn't we just specialcase strings specifically, to keep
At 10:28 AM 1/16/05 +0100, Martin v. Löwis wrote:
Phillip J. Eby wrote:
Couldn't we require new-style exceptions to inherit from Exception?
Since there are no new-style exceptions that work now, this can't break
existing code.
This would require to make Exception a new-style class, right?
class
Phillip J. Eby wrote (in
http://mail.python.org/pipermail/python-dev/2005-January/050854.html)
* Classic class support is a must; exceptions are still required to be
classic, and even if they weren't in 2.5, backward compatibility should be
provided for at least one release.
The base of the
The base of the Exception hierarchy happens to be a classic class.
But why are they required to be classic?
More to the point, is this a bug, a missing feature, or just a bug in
the documentation for not mentioning the restriction?
It's an unfortunate feature; it should be mentioned in the
On 2005-01-16, at 02.57, Guido van Rossum wrote:
It's been suggested that all exceptions should inherit from Exception,
but this would break tons of existing code, so we shouldn't enforce
that until 3.0. (Is there a PEP for this? I think there should be.)
What would happen if Exception were made a
At 05:57 PM 1/15/05 -0800, Guido van Rossum wrote:
It's been suggested that all exceptions should inherit from Exception,
but this would break tons of existing code, so we shouldn't enforce
that until 3.0. (Is there a PEP for this? I think there should be.)
Couldn't we require new-style exceptions
20 matches
Mail list logo