On Dec 21, 2:58 pm, Lie <[EMAIL PROTECTED]> 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.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to