[issue19016] autospecced namedtuples should be truthy by default

2013-09-26 Thread Shawn Krisman
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

[issue19016] autospecced namedtuples should be truthy by default

2013-09-16 Thread Shawn Krisman
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

[issue19016] autospecced namedtuples should be truthy by default

2013-09-14 Thread Shawn Krisman
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