Re: different behaviour for user defined exception with attribute args

2009-09-29 Thread Dave Angel
Visco Shaun wrote: Hi all For an exception defined as below class OptionError(Exception): def __init__(self, args): self.args = args def __str__(self): return repr(self.v) an iteration is happening when the exception is raised What is self.v intended to produce?

Re: different behaviour for user defined exception with attribute args

2009-09-29 Thread M.-A. Lemburg
Visco Shaun wrote: > Hi all > > For an exception defined as below > > class OptionError(Exception): > def __init__(self, args): > self.args = args This should read: def __init__(self, *args): self.args = args (notice the * !) self.args holds the constructor argument tu

different behaviour for user defined exception with attribute args

2009-09-29 Thread Visco Shaun
Hi all For an exception defined as below class OptionError(Exception): def __init__(self, args): self.args = args def __str__(self): return repr(self.v) an iteration is happening when the exception is raised Meanwhile for almost the same structured exception replacing th