Skip to content

Commit

Permalink
add 'flagged by pyright' comments for code review
Browse files Browse the repository at this point in the history
  • Loading branch information
jab committed Mar 10, 2022
1 parent 5d76ab7 commit 7129938
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bidict/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,15 +497,15 @@ def _init_from(self, other: MapOrIterItems[KT, VT]) -> None:
def __or__(self: BT, other: t.Mapping[KT, VT]) -> BT:
"""Return self|other."""
if not isinstance(other, t.Mapping):
return NotImplemented
return NotImplemented # flagged by pyright
new = self.copy()
new._update(other, rbof=False)
return new

def __ror__(self: BT, other: t.Mapping[KT, VT]) -> BT:
"""Return other|self."""
if not isinstance(other, t.Mapping):
return NotImplemented
return NotImplemented # flagged by pyright
new = self.__class__(other)
new._update(self, rbof=False)
return new
Expand Down
4 changes: 2 additions & 2 deletions bidict/_orderedbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Node:
__slots__ = ('_prv_weak', 'nxt', '__weakref__')

def __init__(self, prv: 'Node', nxt: 'Node') -> None:
self.prv = prv
self.prv = prv # flagged by pyright
self.nxt = nxt

def unlink(self) -> None:
Expand Down Expand Up @@ -98,7 +98,7 @@ def new_last_node(self) -> Node:
"""Create and return a new terminal node."""
old_last = self.prv
new_last = Node(old_last, self)
old_last.nxt = self.prv = new_last
old_last.nxt = self.prv = new_last # flagged by pyright
return new_last


Expand Down

0 comments on commit 7129938

Please sign in to comment.