Skip to content

Commit e2c4ab2

Browse files
committed
more syntax
1 parent 2730713 commit e2c4ab2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/simbids/utils/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import logging
2626
from pathlib import Path
27+
2728
import yaml
2829

2930
LGR = logging.getLogger(__name__)
@@ -278,9 +279,9 @@ def _convert_to_serializable(obj):
278279
"""Convert BIDS objects to basic Python types for YAML serialization."""
279280
if hasattr(obj, 'get_metadata'):
280281
return obj.get_metadata()
281-
if isinstance(obj, (int, float, str, bool, type(None))):
282+
if isinstance(obj, int | float | str | bool | type(None)):
282283
return obj
283-
if isinstance(obj, (list, tuple)):
284+
if isinstance(obj, list | tuple):
284285
return [_convert_to_serializable(item) for item in obj]
285286
if isinstance(obj, dict):
286287
return {k: _convert_to_serializable(v) for k, v in obj.items()}

0 commit comments

Comments
 (0)