[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-10-11 Thread Max Rothman
Max Rothman added the comment: Hi, I'd like to wrap this ticket up and get some kind of resolution, whether it's accepted or not. I'm new to the Python community, what's the right way to prompt a discussion about this sort of thing? Should I have taken it to one o

[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-07-18 Thread Max Rothman
Max Rothman added the comment: Hi, just wanted to ping this again and see if there was any movement. -- ___ Python tracker <http://bugs.python.org/issue30

[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-07-12 Thread Max Rothman
Max Rothman added the comment: > Generally the called with asserts can only be used to match the *actual > call*, and they don't determine "equivalence". That's fair, but as unittest.mock stands now, it *does* check equivalence, but only partially, which is more conf

[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-06-30 Thread Max Rothman
Max Rothman added the comment: I'd be happy to look at submitting a patch for this, but it'd be helpful to be able to ask questions of someone more familiar with unittest.mock's code. -- ___ Python tracker <http://bugs.pyt

[issue30821] unittest.mock.Mocks with specs aren't aware of default arguments

2017-06-30 Thread Max Rothman
New submission from Max Rothman: For a function f with the signature f(foo=None), the following three calls are equivalent: f(None) f(foo=None) f() However, only the first two are equivalent in the eyes of unittest.mock.Mock.assert_called_with: >>> with patch('__main__.f'

[issue29715] Arparse improperly handles "-_"

2017-03-12 Thread Max Rothman
Max Rothman added the comment: I think that makes sense, but there's still an open question: what should the correct way be to allow dashes to be present at the beginning of positional arguments? -- ___ Python tracker <http://bugs.py

[issue29715] Arparse improperly handles "-_"

2017-03-04 Thread Max Rothman
Max Rothman added the comment: Martin: huh, I didn't notice that documentation. The error message definitely could be improved. It still seems like an odd choice given that argparse knows about the expected spec, so it knows whether there are any options or not. Perhaps one could e

[issue29715] Arparse improperly handles "-_"

2017-03-03 Thread Max Rothman
New submission from Max Rothman: In the case detailed below, argparse.ArgumentParser improperly parses the argument string "-_": ``` import argparse parser = argparse.ArgumentParser() parser.add_argument('first') print(parser.parse_args(['-_'])) ``` Expected be