Repository: Textualize/textual

Issue:
`Switch.action_toggle` name clash
Similar to #4214 `Switch` has an `action_toggle` method whose name and form clash with `DOMNode.action_toggle`.

Discussion:

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5b3d4909d..3aa2cf3dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 - Fixed `RichLog.min_width` not being used https://github.com/Textualize/textual/pull/4223
 - Rename `CollapsibleTitle.action_toggle` to `action_toggle_collapsible` to fix clash with `DOMNode.action_toggle` https://github.com/Textualize/textual/pull/4221
 - Markdown component classes weren't refreshed when watching for CSS https://github.com/Textualize/textual/issues/3464
+- Rename `Switch.action_toggle` to `action_toggle_switch` to fix clash with `DOMNode.action_toggle` https://github.com/Textualize/textual/issues/4262
 
 ### Changed
 
diff --git a/src/textual/widgets/_switch.py b/src/textual/widgets/_switch.py
index 3060163bf..b6dbe5f6e 100644
--- a/src/textual/widgets/_switch.py
+++ b/src/textual/widgets/_switch.py
@@ -26,7 +26,7 @@ class Switch(Widget, can_focus=True):
     """
 
     BINDINGS: ClassVar[list[BindingType]] = [
-        Binding("enter,space", "toggle", "Toggle", show=False),
+        Binding("enter,space", "toggle_switch", "Toggle", show=False),
     ]
     """
     | Key(s) | Description |
@@ -164,7 +164,7 @@ class Switch(Widget, can_focus=True):
         event.stop()
         self.toggle()
 
-    def action_toggle(self) -> None:
+    def action_toggle_switch(self) -> None:
         """Toggle the state of the switch."""
         self.toggle()
 


Test patch:
diff --git a/tests/animations/test_switch_animation.py b/tests/animations/test_switch_animation.py
index 333e6903f..91903f122 100644
--- a/tests/animations/test_switch_animation.py
+++ b/tests/animations/test_switch_animation.py
@@ -21,7 +21,7 @@ async def test_switch_animates_on_full() -> None:
         animator = app.animator
         # Freeze time at 0 before triggering the animation.
         animator._get_time = lambda *_: 0
-        switch.action_toggle()
+        switch.action_toggle_switch()
         await pilot.pause()
         # Freeze time after the animation start and before animation end.
         animator._get_time = lambda *_: 0.01
@@ -40,7 +40,7 @@ async def test_switch_animates_on_basic() -> None:
         animator = app.animator
         # Freeze time at 0 before triggering the animation.
         animator._get_time = lambda *_: 0
-        switch.action_toggle()
+        switch.action_toggle_switch()
         await pilot.pause()
         # Freeze time after the animation start and before animation end.
         animator._get_time = lambda *_: 0.01
@@ -59,7 +59,7 @@ async def test_switch_does_not_animate_on_none() -> None:
         animator = app.animator
         # Freeze time at 0 before triggering the animation.
         animator._get_time = lambda *_: 0
-        switch.action_toggle()
+        switch.action_toggle_switch()
         await pilot.pause()
         # Freeze time after the animation start and before animation end.
         animator._get_time = lambda *_: 0.01