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

Ben Finney ben+python at benfinney.id.au
Thu Jul 16 22:59:16 CEST 2015

Ethan Furman <ethan at stoneleaf.us> writes:

> On 07/16/2015 01:29 PM, Michael Foord wrote:
> > On Tuesday, 14 July 2015, Christie Wilson wrote:
> >> 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!
> This is good.  :)

It's good that bugs were found. That does not argue for making an alias
in the library, though; it better argues for those projects adding a
linter check for the common misspellings.

> > 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.

Advocating for a clean API is ridiculous? That's a disturbing attitude
to hear from a Python standard library contributor.

> On the serious side, Python is not a DWIM language, and making
> accommodations for a misspelling feels very DWIMish. As I said in an
> earlier email part of writing good tests is double-checking that a
> test is failing (and for the right reasons). And yes, I am guilty of
> writing bad tests, and getting bit by it, and no, I still don't want
> the testing framework (or any part of Python) guessing what I meant.


These checks are a good thing, but they belong in a linter tool not as
aliases in the API.

 \      “You say “Carmina”, and I say “Burana”, You say “Fortuna”, and |
  `\    I say “cantata”, Carmina, Burana, Fortuna, cantata, Let's Carl |
_o__)                                the whole thing Orff.” —anonymous |
Ben Finney

More information about the Python-Dev mailing list