Exception class documentation

Gerald Britton gerald.britton at gmail.com
Fri Feb 5 14:13:36 EST 2010


On Fri, Feb 5, 2010 at 12:55 PM, Charles Yeomans <charles at declaresub.com> wrote:
> I am so far unable to find the information I want about the Exception class.
>  Information like the signature of __init__ seems to be unavailable.  Any
> suggestions where I might find such information?
>
>
> Charles Yeomans
> --
> http://mail.python.org/mailman/listinfo/python-list
>

Though not documented, some silly tests indicate that it will accept
pretty much anything:

>>> Exception(1,2,4,54)
Exception(1, 2, 4, 54)
>>> Exception(*range(10))
Exception(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
>>> Exception(*range(50))
Exception(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49)
>>> Exception('a','b','c','d','e')
Exception('a', 'b', 'c', 'd', 'e')
>>> Exception(Exception(1))
Exception(Exception(1,),)

-- 
Gerald Britton



More information about the Python-list mailing list