[issue34716] MagicMock.__divmod__ should return a pair

2020-10-19 Thread Zachary Ware
Change by Zachary Ware : -- versions: +Python 3.10 -Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Change by Jackson Riley : -- keywords: +patch pull_requests: +16784 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17291 ___ Python tracker ___

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-20 Thread Jackson Riley
Jackson Riley added the comment: Ah thank you Vedran, that makes sense. In that case, I think I'll make a start on implementing Serhiy's second suggestion - returning a pair of MagicMock instances when MagicMock.__divmod__ is called. -- ___

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-13 Thread Vedran Čačić
Vedran Čačić added the comment: Yes, this is impossible using only "universal Python" (independent of implementation). Though, of course, it's possible in CPython if you analyze the source code (or AST) and count the targets on the left side. -- nosy: +veky

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-13 Thread Jackson Riley
Jackson Riley added the comment: On second thoughts, perhaps option 2 is best (more in keeping with the usual behaviour of MagicMock). Alternatively, could I propose a fourth option: 4. Change the behaviour of MagicMock more generally such that trying to unpack a MagicMock instance into two

[issue34716] MagicMock.__divmod__ should return a pair

2019-11-12 Thread Jackson Riley
Jackson Riley added the comment: Hi Serhiy, Option 3 sounds most sensible to me. I'd be happy to pick up this issue, please do let me know. -- nosy: +jacksonriley ___ Python tracker

[issue34716] MagicMock.__divmod__ should return a pair

2018-09-17 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34716] MagicMock.__divmod__ should return a pair

2018-09-17 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : It is documented, that divmod() returns a pair. It is usually used with tuple unpacking: x, y = divmod(a, b) But this doesn't work when one of arguments is a MagicMock. >>> from unittest.mock import * >>> x, y = divmod(MagicMock(), 2) Traceback