> Why can't we simply change the default for bare except clauses? Because there's too much code that depends on it. > I.e. > > try: > ... > except: > ... > > gets equivalent to > > try: > ... > except StandardError: > ... > > To catch everything, write: > > try: > ... > except Exception: > ... Not all exception classes derive from Exception. > What about string exceptions? Another good reason not to change the default. These won't be removed from the language until Python 3.0 -- there's simply too much legacy code that uses it. (We should try to issue warnings when a string exception is raised or tested for though starting in 2.3.) --Guido van Rossum (home page: http://www.python.org/~guido/)
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