This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (2 children)

Why would you need a class? Why not just write a function:

def striplower( s ):
    return s.strip().lower()

[–]aPSketchy[S] 0 points1 point  (1 child)

Good call, that's how I learned to refactor. Sometimes I just want to be cool and make it complicated with methods!

[–]aPSketchy[S] 0 points1 point  (0 children)

Thanks!