获取最终传递给 `on` 的参数 参数: update: 更新的关键字参数 exclude: 需要排除的参数
(
self, update: dict[str, Any], *, exclude: set[str] | None = None
)
| 443 | """其他传递给 `on` 的参数默认值""" |
| 444 | |
| 445 | def _get_final_kwargs( |
| 446 | self, update: dict[str, Any], *, exclude: set[str] | None = None |
| 447 | ) -> dict[str, Any]: |
| 448 | """获取最终传递给 `on` 的参数 |
| 449 | |
| 450 | 参数: |
| 451 | update: 更新的关键字参数 |
| 452 | exclude: 需要排除的参数 |
| 453 | """ |
| 454 | final_kwargs = self.base_kwargs.copy() |
| 455 | final_kwargs.update(update) |
| 456 | if exclude: |
| 457 | for key in exclude: |
| 458 | final_kwargs.pop(key, None) |
| 459 | final_kwargs["_depth"] = 1 |
| 460 | return final_kwargs |
| 461 | |
| 462 | |
| 463 | class CommandGroup(_Group): |
no test coverage detected