Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:

> For the regexp methods we should use assertRegexp 

assertRegex is better.  it matches the name used in other unittest 
implementations, there is not confusion with camel casing RegExp vs Regexp, and 
it matches the former name of Python's own regex module.

> We should leave the gt / le / lt methods as they are. 

The assertLessEqual name is non-standard, it will never be spelled right by 
someone who hasn't used it recently.


> The documentation can be improved by moving *all* the deprecated 
> methods (new and old) out of the main documentation and
> into a separate section at the end of the documentation

See issue 10242 for a suggestion on how to handle renaming (document the new 
and old name in the same entry, noting that one name is old).


>> For assertItemsEqual Raymond suggests assertElementCountsEqual. 
> Why replace a long awkward name with an even longer 
> and more awkward name?

If length is an issue, assertCountsEqual will also do fine.  The important 
virtue is clarity.  The problem with ItemsEqual is that it doesn't tell you 
anything about what it does (unordered comparison where duplicates matter).  
Also, the term "items" in Python usually means key/value pairs.  That is why we 
use the term "elements" in sets, itertools, etc.  In contrast, 
assertCountsEqual tells you what it does, compares the element counts.  It is 
the same as Counter(a)==Counter(b) for hashable elements and an equivalent for 
unhashable elements.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10273>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to