"What is the name of the function/method that called me?"

Cameron Laird claird at starbase.neosoft.com
Sun Oct 17 01:06:56 EDT 1999


In article <3807B77A.87D824F8 at bioreason.com>,
Andrew Dalke <dalke at bioreason.com> wrote:
>Jim Althoff <jima at aspectdv.com>:
>> So does
>>>> >>>try:
>> >>> raise: "Hack"
>> >>>except "Hack"
Is there a profound and/or interesting
reason Python doesn't provide the kinds
of introspective features we're discus-
sing here (a traceback, for example)
without the detour through the land of
exception-tossing?
			.
			.
			.
>So string literals work, likely because they are interned to
>the same object, but equivalent strings don't work. I believe
>there is some history to things working this way because
>exceptions in Python used to be string only.
>>>BTW, my standard code for generating exceptions is
>>try:
> 1/0
>except ZeroDivisionError:
> print "Ok"
Me, too!
			.
			.
			.
-- 
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird at NeoSoft.com +1 281 996 8546 FAX


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /