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/2002-March/020897.html below:

[Python-Dev] For review: PEP 285: Adding a bool type

[Python-Dev] For review: PEP 285: Adding a bool type [Python-Dev] For review: PEP 285: Adding a bool typeFredrik Lundh fredrik@pythonware.com
Sun, 10 Mar 2002 23:57:02 +0100
david wrote:
> Good point.  This reminds me of the unofficial deprecation of string
> exceptions.  I still find using string exceptions is darn convenient. 
> Just adding 'import exceptions' is enough of a step to stop me from
> doing it 'right'

umm.  why would you ever need to do that?

>>> dir(__builtins__)
['ArithmeticError', ...]
>>> import exceptions
>>> dir(exceptions)
['ArithmeticError', ...]
>>> for name in dir(exceptions):
...     if getattr(__builtins__, name, None) == None:
...             print name, "is missing"
...
>>>

and if you don't want to, you don't have to inherit from the
Exception class either.  the difference between

    MyException = "MyException"

and

    class MyException: pass

isn't really that big...

</F>




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