Message950

Author lilachb
Recipients
Date 2005-02-22.20:52:15
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
When defining a class that overloads the __str__ 
method and raises an exception in the overloaded 
method, for example

class C:
  def __str__(self):
    raise Exception("i am an exception")

If we call str on an object of this class the exception will 
not be raised

x=C()
str(x)

(no exception will be reported by jython)

P.S.
when using x.__str__() the exception will be raised and 
jython will display it
History
Date User Action Args
2008-02-20 17:17:21adminlinkissue1149372 messages
2008-02-20 17:17:21admincreate