From 4b2a9f2655a531e2a08edcdfba5b877a99643077 Mon Sep 17 00:00:00 2001 From: "Andreas Koepf (aider)" Date: Thu, 23 Jan 2025 21:46:06 +0100 Subject: [PATCH] refactor: Remove unnecessary rstrip('L') calls in base conversion --- reasoning_gym/algorithmic/base_conversion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reasoning_gym/algorithmic/base_conversion.py b/reasoning_gym/algorithmic/base_conversion.py index 766c619c..779f0f7c 100644 --- a/reasoning_gym/algorithmic/base_conversion.py +++ b/reasoning_gym/algorithmic/base_conversion.py @@ -73,12 +73,12 @@ class BaseConversionDataset: # Convert decimal to source base representation source_repr = format(value, f'x' if source_base == 16 else f'b' if source_base == 2 else '').strip() if source_base not in (2, 16): - source_repr = format(value, f'{source_base}x').rstrip('L').lower().strip() + source_repr = format(value, f'{source_base}x').lower().strip() # Convert decimal to target base for answer target_repr = format(value, f'x' if target_base == 16 else f'b' if target_base == 2 else '').strip() if target_base not in (2, 16): - target_repr = format(value, f'{target_base}x').rstrip('L').lower().strip() + target_repr = format(value, f'{target_base}x').lower().strip() source_name = self._format_base_name(source_base) target_name = self._format_base_name(target_base)