Skip to content

[Clock] Improved/additional tests for __add__ and __sub__ #3008

@IsaacG

Description

@IsaacG

Motivation: I've seem multiple solutions where Clock.__add__ either (1) returns a str or (2) modifies and returns self. Ideally a = b + c should not mutate b or c and Clock + int should return a Clock.

Proposal: Add a test or two where,

now = Clock(0, 0)
future = now + 5
test.assertNotEqual(now, future)
test.assertEqual(future, Clock(0, 5))

Possibly replicate for __sub__ as well.

I'd be happy to work on this myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions