Accept language wip #335
This is mostly a copy of AcceptLanguage.__contains__. Changes: - It calls ._old_match() instead of ._match(). - It returns False instead of None when no matches found. - Additional documentation and pending-deprecation warning. - Tests changed to use @pytest.mark.parametrize.
A class returns True for .__nonzero__/.__bool__ by default, but we write a method so we can document it and have a consistent interface across the three AcceptLanguage classes.
There is no need to check offer. If we were to check, it would probably be better as an assert, but there is no need, as the offers are specified to be language tags in the documentation. This method was copied from NilAccept.best_match. The original corresponding method AcceptLanguage, AcceptLanguage.best_match, did not call _check_offer either (not even in ._match).
@bertjwregeer: I've made the changes you requested — thanks for reviewing! With #256,