The documentation states that:
A lamba function which has a single objective of passing all it is arguments to another callable can be safely replaced by that callable.
But this is not always true. For instance:
get_now_isoformat = lambda: datetime.now().isoformat()
This will be autofixed this way:
get_now_isoformat = datetime.now().isoformat
But the two functions do not have the same behaviour:
>>> # A different result is returned everytime the function is called
>>> get_now_isoformat_v1() == get_now_isoformat_v1()
False
>>> # The result is "frozen"
>>> get_now_isoformat_v2() == get_now_isoformat_v2()
True