def METHOD_NAME():
    def foo():
        pass
    assert "foo" in str(foo)
    assert foo.__name__ == "foo"
    foo.__name__ = "bar"
    assert foo.__name__ == "bar"
    assert "bar" not in str(foo)
    assert "foo" in str(foo)
    try:
        foo.__name__ = 42
    except TypeError as e:
        assert "__name__ must be set to a string object" in str(e)
    else:
        assert False