← Back to team overview

larry-discuss team mailing list archive

stream lining signature of assert_larry_equal

 

The current signature

assert_larry_equal(actual, desired, msg='', dtype=True, original=None,
                       noreference=True, nocopy=False)

has 3 keywords, original, noreference, nocopy for the option to check
whether a larry is a view or a copy.

This makes 8 binary options, only 3 are relevant cases, the other 5
combinations raise errors or are redundant. This was quite confusing
when I used the tests, since I often forgot to use, reset a keyword,
e.g. nocopy=True also requires setting noreference = False

I think a more compact signature would be
assert_larry_equal(actual, desired, msg='', dtype=True, original=None,
noref=True)

if not original is None:
    if noref:
       check noreference
    else:
       check nocopy

otherwise don't do any reference/copy check

the presence of original would indicate that we want the view check,
`noref` would tell which one.

Josef



Follow ups