[Python-Dev] How far to go with user-friendliness

Berker Peksağ berker.peksag at gmail.com
Wed Jul 15 00:58:44 CEST 2015


On Wed, Jul 15, 2015 at 1:22 AM, Robert Collins
<robertc at robertcollins.net> wrote:
> On 15 July 2015 at 10:05, Ethan Furman <ethan at stoneleaf.us> wrote:
>> On 07/14/2015 02:53 PM, Robert Collins wrote:
> ...
>>>> I don't think unittest can protect its users from such things.
>>>
>>>
>>> It can't, but there is a sliding scale of API usability, and we should
>>> try to be up the good end of that :).
>>
>>
>> I hope you're not suggesting that supporting misspellings, and thereby
>> ruling out the proper use of an otherwise fine variable name, is at the good
>> end of that scale?
>
> I'm not supporting the misspelling thing - see my suggestion earlier
> in this thread to move the mock assertions to standalone functions,
> removing the bug in that area *entirely* and eventually removing the
> check for method names starting with assert from mock entirely.
>
> What I am doing is rejecting the argument that because we can't fix
> every mis-use users might make, we therefore should not fix the cases
> where we can fix it.
>
> For clarity, I think we should:
>  - remove the assret check, it is I think spurious.
>  - add a set of functions to the mock module that should be used in
> preference to Mock.assert*
>  - mark the Mock.assert* functions as PendingDeprecation
>  - in 3.6 move the PendingDeprecation to Deprecated
>  - in 3.7 remove the Mock.assert* functions and the check for method
> names beginning with assert entirely.

+1, but I think we need to get Larry's approval for the steps 2 and 3
because 3.5 is in feature-freeze mode.

--Berker


More information about the Python-Dev mailing list