Author chepner
Recipients chepner
Date 2014-08-05.04:14:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407212040.69.0.583222239779.issue22138@psf.upfronthosting.co.za>
In-reply-to
Content
Following a patch, a function's __defaults__ attribute is reset to None.

    def foo(x=5):
        return x

    assert foo() == 5  # As expected
    with unittest.mock.patch.object(foo, '__defaults__', (10,)):
        assert foo() == 10  # As expected

    assert foo() == 5  # Fails
    assert foo.__defaults__ is None  # Succeeds
History
Date User Action Args
2014-08-05 04:14:00chepnersetrecipients: + chepner
2014-08-05 04:14:00chepnersetmessageid: <1407212040.69.0.583222239779.issue22138@psf.upfronthosting.co.za>
2014-08-05 04:14:00chepnerlinkissue22138 messages
2014-08-05 04:14:00chepnercreate