Re: [Python-ideas] collections.Counter should implement fromkeys

[Michael Selik]
That's a distinct possibility, but this is far from the first time I've wanted for a better way to initialize a Counter. It's just a simple example for which there are many many alternative approaches. If' you're interested, I have a more complete implementation of the game of life here <https://repl.it/@AbeDillon/Life>. [Michael Selik]
That happens more frequently than my OOP professor seemed to think. I end up with platypi (platypuses?) all too often.
Yes, I always try to caution my own students against strict adherence to any ideology, methodology, or cult. "Always do this" and "Never do that" rules are useful crutches for novices trying to navigate the complex world of coding for the first time, but pros are the ones who are experienced enough to know when it's OK to break the rules. When GoTo isn't harmful. When to break the rule of thirds <https://www.youtube.com/watch?v=hyGAgqfoUo8>. Obviously, Python breaks SOLID principals successfully all over the place for pragmatic reasons. I don't think this is one of those cases.
participants (1)
-
Abe Dillon