Commit
* Update _orderedbidict.py with an additional type annotation required by the lastest version of pyright. * Pin to docutils 0.17.1 while sphinx-doc/sphinx#10531 is unfixed.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,8 @@ def method(self: t.Union[_OrderedBidictKeysView[KT], _OrderedBidictItemsView[KT, | |
# Use arg's backing dict's corresponding view instead of arg. Otherwise, e.g. `ob1.keys() < ob2.keys()` would give | ||
# "TypeError: '<' not supported between instances of '_OrderedBidictKeysView' and '_OrderedBidictKeysView'", because | ||
# both `dict_keys(ob1).__lt__(ob2.keys()) is NotImplemented` and `dict_keys(ob2).__gt__(ob1.keys()) is NotImplemented`. | ||
arg_dict_view = getattr(args[0]._mapping._fwdm, viewname)() | ||
arg_dict: t.Dict[t.Any, t.Any] = args[0]._mapping._fwdm | ||
arg_dict_view = getattr(arg_dict, viewname)() | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
erictraut
|
||
return fwdm_dict_view_method(arg_dict_view) | ||
method.__name__ = methodname | ||
method.__qualname__ = f'{cls.__qualname__}.{methodname}' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
furo | ||
sphinx | ||
docutils==0.17.1 # TODO: remove this line once https://github.com/sphinx-doc/sphinx/issues/10531 is fixed | ||
sphinx-copybutton |
@erictraut, in case this seems like a possible recent regression in pyright:
As part of monthly maintenance, this PR upgrades pyright from version 1.1.252 to 1.1.256, and this caused the following new error to be emitted here on line 144 without the changes on these two lines:
Seems like this could be a case of pyright's type inference either getting better or worse, so I'm not reporting this as a bug in pyright while I don't know which.
Hope the ping here is helpful in any case!