exception message output problem
Russ P.
Russ.Paielli at gmail.com
Fri Dec 21 18:52:58 EST 2007
On Dec 21, 2:58 pm, Lie <Lie.1... at gmail.com> wrote:
> Change the exception into this:
> class InconsistentUnits(Exception):
> def __init__(self, args=""): self.args = (args,)
> # Python have an odd (read: broken) singleton implementation
> # single member tuple must have a comma behind it
Hey, that worked. Thanks.
Actually, the parens aren't needed, so this works too:
def __init__(self, args=""): self.args = args,
The trailing comma wasn't necessary a while back (pre 2.5?), so
something in Python must have changed. I'd say that it looks a bit
cleaner without the trailing comma, so maybe whatever changed should
get changed back.
More information about the Python-list
mailing list