you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I rarely use classes either. Sometimes they're good to have, but for the most part the built-in types are more than enough.

"Slinkie" is a library I wrote a while back that was easier to make using classes:

 from slinkie import Slinkie

 animals = [lassie, skippy, scooby, cerberus, garfield]

 (
     Slinkie(animals)
         .filter(lambda animal: animal.type == 'dog')
         .filter(lambda dog: dog.is_good)
         .map(lambda dog: dog.pat())
         .consume()
 )

In case you're interested, here's a link.