• SpaceNoodle@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 day ago

    There’s nothing wrong with overloading an operator for other classes; the problem is the unexpected typecasting.

    Python, for example, will allow you to “add” strings to concatenate, but will throw a type error if you attempt to add a string to an integer.