Skip to content

Commit

Permalink
documented optype.CanGetMissing
Browse files Browse the repository at this point in the history
  • Loading branch information
jorenham committed Feb 26, 2024
1 parent e47a92c commit e30b464
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit e30b464

Please sign in to comment.