]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-106664: selectors: add get() method to _SelectorMapping (#106665)
authorJ. Nick Koston <nick@koston.org>
Thu, 13 Jul 2023 19:18:53 +0000 (09:18 -1000)
committerGitHub <noreply@github.com>
Thu, 13 Jul 2023 19:18:53 +0000 (19:18 +0000)
commit8d2f3c36caf9ecdee1176314b18388aef6e7f2c2
tree8c9db77b946611cc5a758bdeee2bed5efa879bfb
parente6e0ea0113748db1e9fe675be6db9041cd5cce1f
gh-106664: selectors: add get() method to _SelectorMapping (#106665)

It can be used to avoid raising and catching KeyError twice via __getitem__.

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Lib/selectors.py
Lib/test/test_selectors.py
Misc/NEWS.d/next/Library/2023-07-12-03-04-45.gh-issue-106664.ZeUG78.rst [new file with mode: 0644]