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

Michael Foord fuzzyman at gmail.com
Thu Jul 16 22:29:31 CEST 2015

On Tuesday, 14 July 2015, Christie Wilson <bobcatfish at gmail.com> wrote:
>> If people do misspell it, I think they do learn not to in after it
happens a few times.
> Unless the line silently executes and they don't notice the mistake for
years :'(

Indeed. This has been a problem with mock, misspelled (usually
misremembered) assert methods silently did nothing.

With this fix in place several failing tests were revealed in code bases!

As for assret, it's the common misspelling people have told me about. It
seems a ridiculous thing for people to get worked up about, but people
enjoy getting worked up.


> On Tue, Jul 14, 2015 at 9:15 AM, Ron Adam <ron3200 at gmail.com> wrote:
>> On 07/14/2015 09:41 AM, Steven D'Aprano wrote:
>>> On Tue, Jul 14, 2015 at 02:06:14PM +0200, Dima Tisnek wrote:
>>>> >https://bugs.python.org/issue21238  introduces detection of
>>>> >missing/misspelt mock.assert_xxx() calls on getattr level in Python
>>>> >3.5
>>>> >
>>>> >Michael and Kushal are of the opinion that "assret" is a common typo
>>>> >of "assert" and should be supported in a sense that it also triggers
>>>> >AttributeError and is not silently ignored like a mocked user
>>>> >attribute.
>>>> >
>>>> >I disagree
>>> I must admit I don't use mock so don't quite understand what is going on
>>> in this bug report. But I don't imagine that anything good will come out
>>> of treating*one*  typo differently from all the other possible typos.
>>> Why should "assret" be treated differently from other easy-to-make typos
>>> like "asert", "assrt", "asset"? Or "assort", which is not only a
>>> standard and common English word, but "e" and "o" are right next to each
>>> other on Dvorak keyboards, making it an easy typo to make.
>>> Surely this is an obvious case where the Zen should apply. "Special
>>> cases aren't special enough..." -- either all such typos raise
>>> AttributeError, or they are all silent.
>> I agree with Steven that it doesn't seem correct to not raise
AttributeError here.
>> For what it's worth, I have a life long sleep disorder and am a tarrable
(<-- like this)  speller because of it.   I still don't want spell, or
grammar, checkers to not report my mistakes.  And I don't recall ever
making the particular error of using "assret" in place of "assert".  I'd be
more likely to mispell it as "assirt" if I wasn't already so familiar with
>> If people do misspell it, I think they do learn not to in after it
happens a few times.
>> Regards,
>>    Ron
>> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> https://mail.python.org/mailman/listinfo/python-dev
>> Unsubscribe:
> --
> Christie Wilson



May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150716/3bd05a32/attachment.html>

More information about the Python-Dev mailing list