A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-April/078751.html below:

[Python-Dev] thoughts on having EOFError inherit from EnvironmentError?

[Python-Dev] thoughts on having EOFError inherit from EnvironmentError? [Python-Dev] thoughts on having EOFError inherit from EnvironmentError?Steven steve at pearwood.info
Sat Apr 19 04:12:55 CEST 2008
On Sat, 19 Apr 2008 12:18:47 +1200
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Antoine Pitrou wrote:
> 
> > Why do you want to derive program bugs from EnvironmentError ? Usually I derive
> > them from ValueError, RuntimeError or simply Exception.
> 
> I'm *not* talking about program bugs, I'm talking about
> exceptions due to something the user did wrong.
> 
> I like to be able to do this:
> 
>    try:
>      f = open(somefile)
>      mungulate(f)
>      f.close()
>    except EnvironmentError, e:
>      big_nasty_alert("Couldn't mungulate: %s" % e)


It might help if you explain what sort of actual things that the user does 
wrong that you are talking about. From where I'm sitting, the only thing I 
can see that the user could do wrong is specify the wrong file. That doesn't
sound like an EnvironmentError to me, but I don't know that it should be a 
ValueError or TypeError either.



-- 
Steven <steve at pearwood.info>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4