Shawn Krisman added the comment:
This fix is actually backwards compatible. This is a more powerful patch too
because not only does it provide a better default for truthiness, but it also
provides a better default for length. I also fixed a spelling mistake involving
the word calculate
Shawn Krisman added the comment:
Yeah in my head I was thinking it would affect relatively few people who
depended on the change, but it's definitely hard to prove that!
How about a change that special cases namedtuple?
--
___
Python tracker rep
New submission from Shawn Krisman:
import mock
from collections import namedtuple
Foo = namedtuple('Foo', bar)
mock_foo = mock.create_autospec(Foo)
if mock_foo:
print('the namedtuple is truthy')
else:
print('the namedtuple is not truthy')
The expected behavior is that it should print