[Python-3000] removing exception .args (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jul 22 02:26:24 CEST 2007
- Previous message: [Python-3000] removing exception .args
- Next message: [Python-3000] removing exception .args
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Georg Brandl wrote:
Hm, I always found it useful to just do
class MyCustomError(Exception): pass and give it arbitrary arguments to it without writing init method stuff that I can access from outside.
Maybe
class Exception(object):
def __init__(self, msg = None, **kwds):
self.msg = msg
self.__dict__.update(kwds)
Then you'd have to pass your extra args as keyword args, but you could still avoid having an init if you wanted.
-- Greg
- Previous message: [Python-3000] removing exception .args
- Next message: [Python-3000] removing exception .args
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]