gh-142085: Avoid raising in ChainMap.__ior__ before trying other.__ror__#142087
gh-142085: Avoid raising in ChainMap.__ior__ before trying other.__ror__#142087ChuheLin wants to merge 8 commits intopython:mainfrom
ChainMap.__ior__ before trying other.__ror__#142087Conversation
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
1 similar comment
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
a3f5094 to
f2826a9
Compare
| @@ -0,0 +1 @@ | |||
| Fix ``ChainMap.__ior__`` to return ``NotImplemented`` instead of raising ``TypeError`` for unsupported types. | |||
There was a problem hiding this comment.
| Fix ``ChainMap.__ior__`` to return ``NotImplemented`` instead of raising ``TypeError`` for unsupported types. | |
| Fix :class:`ChainMap.__ior__ <collections.ChainMap>` to return :data:`NotImplemented` | |
| instead of raising :exc:`TypeError`` for unsupported types. |
We still want something we can click on even if it's the expected method.
…u8i9o.rst Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
Sorry I added two backticks in my suggestion! |
…u8i9o.rst Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
ChainMap.__ior__ before trying other.__ror__
|
Considering that this would create an exceptional case (see #142085 (comment)), we are going to close this one until support has been gathered for that change. Sorry for the false hope but thank you for pointing out this. |
|
"Thanks for the detailed explanation @serhiy-storchaka. I understand now that |
Fixes #142085. ChainMap's
__ior__method now returnsNotImplementedinstead of raisingTypeErrorwhenupdatefails, allowing the fallback to__ror__to work correctly.