String Exceptions (PEP 352)
Ben Finney
bignose+hates-spam at benfinney.id.au
Thu Apr 27 20:14:18 EDT 2006
Thomas Guettler <niemand.leermann at thomas-guettler.de> writes:
> I like python because it is compatible to old versions.
I like it because it has a documented, manageable procedure for
breaking compatibility with old versions.
> if foo and bar and i>10:
> raise "if foo and bar i must not be greater than 10"
Others have pointed out that this is a job for 'assert'.
> Is it too late to change this?
Yes. PEP-0352 has a status of "Final".
> Way not make this line
>
> raise "..."
>
> behave like this:
>
> raise Exception("...")
>
> in the future?
Because explicit is better than implicit, and special magic behaviour
is to be deprecated (or never implemented) when possible.
> Please keep Python compatible to old versions.
Have a read of PEP 0005:
<URL:http://www.python.org/dev/peps/pep-0005>
Also note that the transition plan (documented in the PEP that
concerns you) shows the support for the old behaviour is not to be
dropped until Python 3.0, a release explicitly targeted at breaking
backward compatibility to clean out crufty behaviour.
--
\ "I went to the hardware store and bought some used paint. It |
`\ was in the shape of a house." -- Steven Wright |
_o__) |
Ben Finney
More information about the Python-list
mailing list