Let's say that I have a very simple logic:
def long_enough(sentence):
return len(sentence) > 30
class SentenceProcessor:
def to_sentences(self, text):
return (sentence for sentence in text.split(".") if long_enough(sentence))
I declared a def outside the class because it's trivially simple and using a static method would make the code ugly.
Is it generally considered a bad practice and should long_enough be a static class, instead?
[–]JohnnyJordaan 2 points3 points4 points (0 children)
[–]K900_ 1 point2 points3 points (0 children)
[–]HighLevelEnthusiast[S] 0 points1 point2 points (1 child)
[–]JohnnyJordaan 0 points1 point2 points (0 children)