Simon Brunning
Simon Brunning
> It's also not pythonic to do `isinstance` checks when duck typing Oh, I couldn't agree more. The whole overloading, one function with multiple signatures thing is left over from...
If only [`singledispatch`](https://docs.python.org/3/library/functools.html#functools.singledispatch) allowed dispatching on the 2nd argument, that would be *much* nicer.
Hmmmmm. I can see what's going on here. It's not that `contains_inanyorder` is order sensitive, it's that overgeneral matchers can _consume_ items from the actuals, leaving more specific matchers to...
In the meantime, the matcher is working as documented, and you can support your use case by specifying the more specific matchers first, then the less specific.
Interesting, but I'm not sure I think the complexity is worthwhile. How often is this an issue? If we implemented a maximum cardinality matching algorithm, how would that work with...
`python-i18n` looks reasonable - but do wait for some input from @offbyone before putting too much time into this, I suggest.
OTOH, using `gettext` would avoid adding an additional runtime dependency. [A complete guide to i18n in Python](https://www.mattlayman.com/blog/2015/i18n/) looks like a reasonable approach.
You question isn't really clear, I'm afraid. Most matchers can take nested matchers in addition to literal values, so I expect what you want is possible, but I'd need a...
You can compose a custom matcher for this fairly easily: ```python import collections from dataclasses import dataclass from typing import Any, Dict from hamcrest import assert_that, contains_inanyorder, has_entries, has_property from...
`assert_that()` has two forms - `assert_that(actual, matcher, [reason])` and `assert_that(assertion, [reason])`. The call you're making isn't of the 1st form, because the 2nd argument isn't a matcher, so it's falling...