A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2010-December/106887.html below:

[Python-Dev] r87389 - in python/branches/py3k: Doc/library/unittest.rst Lib/unittest/case.py Misc/NEWS

[Python-Dev] r87389 - in python/branches/py3k: Doc/library/unittest.rst Lib/unittest/case.py Misc/NEWSAntoine Pitrou solipsis at pitrou.net
Sun Dec 19 14:13:55 CET 2010
On Sat, 18 Dec 2010 20:23:49 -0800
Guido van Rossum <guido at python.org> wrote:
> I may be unique, but I fear there is no great answer. On the one hand
> I almost always code it as e.g. assertEqual(actual, expected), which
> matches my preference for e.g. "if x == 5:" rather than "if 5 == x:".
> On the other hand in those assert* functions that show a nice diff of
> two lists, when reading such a diff my expectation is that "old, new"
> corresponds to "expected, actual". Which then freaks me out until I
> realize that I coded it as "actual, expected"... And yet "expected,
> actual" still looks weird to me. :-(

This could be nicely resolved by renaming the arguments "a" and "b",
and having the diff display "a, b". It's quite natural (both the diff
ordering and the arguments ordering), and they are consistent with each
other.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4