[Python-Dev] Draft Guide for code migration and modernation

Neal Norwitz neal@metaslash.com
Mon, 03 Jun 2002 15:54:20 -0400

Guido van Rossum wrote:
> > Pattern:  NewError = 'NewError' --> class NewError(Exception): pass
> > Idea:     String exceptions are deprecated, derive from Exception base class.
> > Version:  Any
> > Benefits: String exceptions will not work in future versions.  Allows except Exception: clause to work.
> > Locating: Use PyChecker
> Should also warn against class exceptions not deriving from Exception.

I was going to add this check, but I then I noticed I already had. :-)

> Be careful about generic phrases like "String exceptions will not work
> in future versions."  Some people (especially those who tend to fear
> change ;-) start to panic when they read this, thinking it might be in
> 2.4.

Maybe people won't bitch at you so much for things like bool
and will start bitching at me. :-)

On a somewhat related note, I was perusing the Perl 5.8 RC1 notes.
While there was probably not any incompatible change as "major" as bool,
there were many, many "minor" incompatible changes.  Most seemed 
pretty small and had been warned about in the past.

1. I think Python is doing a good job wrt change.
2. Perhaps, there needs to be stronger warnings about
   deprecated or questionable features.  (We seem to be
   working towards this.)


PS I don't view the bool change as major and I think it was a good change.