This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author zach.ware
Recipients larry, zach.ware
Date 2014-01-25.04:12:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390623173.26.0.698416437664.issue20381@psf.upfronthosting.co.za>
In-reply-to
Content
This will still cause issue in _sre.c; repr(sys.maxsize) == '9223372036854775807' != 'sys.maxsize'.

Yes, it's bad form to throw the net too wide, but for anything other than NameError, we fail out in the next block anyway.  My (second) patch just makes for nicer output from the failure, though it does fail to say what the exception was.

What about something more along these lines?

bad = False
try:
    eval(default)
except NameError:
    pass # probably a named constant
except Exception as e:
    fail("Malformed expression given as default value\n"
         "{!r} raised {!r}".format(default, e))
History
Date User Action Args
2014-01-25 04:12:53zach.waresetrecipients: + zach.ware, larry
2014-01-25 04:12:53zach.waresetmessageid: <1390623173.26.0.698416437664.issue20381@psf.upfronthosting.co.za>
2014-01-25 04:12:53zach.warelinkissue20381 messages
2014-01-25 04:12:52zach.warecreate