Repository: mne-tools/mne-python

Issue:
"array-like" check incorrectly accepts strings
### Description of the problem

`_validate_type()` accepts a string parameter value "array-like" to allow checking for array-like input. However, the implementation of this recent addition is incorrect by considering any `Sequence` as `array-like`

https://github.com/mne-tools/mne-python/blob/8c003e843717e316ba85008eff2298917489bbd1/mne/utils/check.py#L545

### Steps to reproduce

```Python
# %%
from typing import Sequence

isinstance("test", Sequence)
```


### Link to data

_No response_

### Expected results

`False`: A string should not be considered `array-like`, at least not for our purposes here.

### Actual results

`True`, as a string is a `Sequence`

### Additional information

cc @cbrnr

Discussion:

Patch:
diff --git a/mne/utils/check.py b/mne/utils/check.py
index a26495106..2faa364b7 100644
--- a/mne/utils/check.py
+++ b/mne/utils/check.py
@@ -8,7 +8,6 @@ import operator
 import os
 import re
 from builtins import input  # no-op here but facilitates testing
-from collections.abc import Sequence
 from difflib import get_close_matches
 from importlib import import_module
 from importlib.metadata import version
@@ -542,7 +541,7 @@ _multi = {
     "path-like": path_like,
     "int-like": (int_like,),
     "callable": (_Callable(),),
-    "array-like": (Sequence, np.ndarray),
+    "array-like": (list, tuple, set, np.ndarray),
 }
 
 


Test patch:
diff --git a/mne/utils/tests/test_check.py b/mne/utils/tests/test_check.py
index 2856d9ea3..2cda3188c 100644
--- a/mne/utils/tests/test_check.py
+++ b/mne/utils/tests/test_check.py
@@ -212,6 +212,11 @@ def test_validate_type():
     _validate_type(1, "int-like")
     with pytest.raises(TypeError, match="int-like"):
         _validate_type(False, "int-like")
+    _validate_type([1, 2, 3], "array-like")
+    _validate_type((1, 2, 3), "array-like")
+    _validate_type({1, 2, 3}, "array-like")
+    with pytest.raises(TypeError, match="array-like"):
+        _validate_type("123", "array-like")  # a string is not array-like
 
 
 def test_check_range():