2018-01-26 10:09 GMT+02:00 Victor Maryama <
victor....@gmail.com>:
>
> @Pekka
>
> I see. If Robot Framework should type-check (strong typing) then you are
> probably correct. But if we just do duck-typing as usual in Python, then we
> could just let the user try to use any objects as if they were dicts and see
> what breaks depending on the type of operation implemented.
I kind of agree with this, but then again also lists have __getitem__
(and are iterable). Considering lists to be dictionaries sounds wrong
to me.
I'm somewhat surprised this object doesn't implement
collections.Mapping if it really is a mapping. One thing you could do
is implementing an proxy that implements collections.Mapping (you only
need to implement __getitem__, __iter__ and __len__) and delegates to
the underlying object.
Cheers,
.peke