Skip to content

Commit 383ccfc

Browse files
committed
Add __or__ to defaultdict
1 parent 81b8211 commit 383ccfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/collections/__init__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ class defaultdict(dict[_KT, _VT], Generic[_KT, _VT]):
391391
def __missing__(self, __key: _KT) -> _VT: ...
392392
def __copy__(self) -> Self: ...
393393
def copy(self) -> Self: ...
394+
if sys.version_info >= (3, 9):
395+
def __or__(self, other: Mapping[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ...
396+
def __ror__(self, other: Mapping[_T1, _T2]) -> defaultdict[_KT | _T1, _VT | _T2]: ...
394397

395398
class ChainMap(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
396399
maps: list[MutableMapping[_KT, _VT]]

0 commit comments

Comments
 (0)