Skip to content

Commit 9c2a504

Browse files
committed
Reflect feedbacks
1 parent 3c9e92c commit 9c2a504

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Lib/collections/_defaultdict.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,18 @@ def __reduce__(self):
4141

4242
def __or__(self, other):
4343
if not isinstance(other, dict):
44-
raise TypeError(f'unsupported operand type(s) for |: \'collections.{self.__class__.__qualname__}\' and \'{type(other).__qualname__}\'')
44+
return NotImplemented
4545

4646
new = defaultdict(self.default_factory, self)
4747
new.update(other)
4848
return new
4949

5050
def __ror__(self, other):
5151
if not isinstance(other, dict):
52-
raise TypeError(f'unsupported operand type(s) for |: \'collections.{self.__class__.__qualname__}\' and \'{type(other).__qualname__}\'')
52+
return NotImplemented
5353

5454
new = defaultdict(self.default_factory, other)
5555
new.update(self)
5656
return new
5757

58-
def __ior__(self, other):
59-
self.update(other)
60-
return self
61-
6258
defaultdict.__module__ = 'collections'

0 commit comments

Comments
 (0)