From e30b4641fb4f720760ad998337ccd52e3007b373 Mon Sep 17 00:00:00 2001 From: jorenham Date: Mon, 26 Feb 2024 11:01:10 +0100 Subject: [PATCH] documented `optype.CanGetMissing` --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a29febb..b49500e6 100644 --- a/README.md +++ b/README.md @@ -349,10 +349,14 @@ yellow snow). | `CanGetitem[K, V]` | `__getitem__(self, k: K) -> V` | `self[k]` | | `CanSetitem[K, V]` | `__setitem__(self, k: K, v: V)` | `self[k] = v` | | `CanDelitem[K]` | `__delitem__(self, k: K)` | `del self[k]` | -| `CanMissing[K, V]` | `__missing__(self, k: K) -> V` | [docs](GM) | +| `CanMissing[K, M]` | `__missing__(self, k: K) -> V` | [docs](GM) | | `CanReversed[Y]` [^4] | `__reversed__(self) -> Y` |`reversed(self)`| | `CanContains[K]` | `__contains__(self, k: K) -> bool` | `x in self` | +Because `CanMissing[K, M]` generally doesn't show itself without +`CanGetitem[K, V]` there to hold its hand, `optype` conveniently stitched them +together as `optype.CanGetMissing[K, V, M]`. + Additionally, `optype` provides protocols for types with (custom) *hash* or *index* methods: