bbelderbos, Use
removesuffix
for safe suffix removal in #Python >= 3.9 (there's alsoremoveprefix
) 🐍Benefits 💡
• It ensures the suffix is present before attempting to remove it.
• It explicitly specifies which suffix to remove, thus avoiding ambiguity.
• Better named methods 😍