From d106e8c7e08cd5eaf88d341e8ee3278668179989 Mon Sep 17 00:00:00 2001 From: Seyamalam Date: Fri, 20 Nov 2026 06:01:22 +0000 Subject: [PATCH] Remove unused Parameters.params() method The method is an undocumented alias for Parameters.keys() with no callers in the codebase, tests, or documentation, and its body is not covered by the test suite. AI disclosure: I used SWE-2 via Devin to identify dead code with a coverage report and an unreferenced-name analysis, and to draft this change. I reviewed and validated the output locally. Contributes to #641 --- news/641.removal | 1 + src/icalendar/parser/parameter.py | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) create mode 100644 news/641.removal diff --git a/news/641.removal b/news/641.removal new file mode 100644 index 000000000..f0ee03d55 --- /dev/null +++ b/news/641.removal @@ -0,0 +1 @@ +Removed the unused ``Parameters.params()`` method, an undocumented alias for ``Parameters.keys()`` with no callers in the codebase. I used SWE-2 to assist with this change. :user:`Seyamalam` diff --git a/src/icalendar/parser/parameter.py b/src/icalendar/parser/parameter.py index 0482beab6..c18651cbb 100644 --- a/src/icalendar/parser/parameter.py +++ b/src/icalendar/parser/parameter.py @@ -20,7 +20,7 @@ from icalendar.timezone.tzid import tzid_from_dt if TYPE_CHECKING: - from collections.abc import Callable, KeysView, Sequence + from collections.abc import Callable, Sequence from icalendar.enums import VALUE from icalendar.parser.xcal.adapter import ElementAdapter @@ -370,12 +370,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: "CN": " '", } - def params(self) -> KeysView[str]: - """In RFC 5545 keys are called parameters, so this is to be consitent - with the naming conventions. - """ - return self.keys() - def to_ical(self, sorted: bool = True) -> bytes: # noqa: A002 """Returns an :rfc:`5545` representation of the parameters.