faif / python-patterns

A collection of design patterns/idioms in Python
40.2k stars 6.93k forks source link

Pass the `move` object to the `do_action()` method #404

Closed asafhad closed 1 year ago

asafhad commented 1 year ago

It makes more sense to pass the move object to the do_action() method instead of having to initialize a Person instance with an Action object. In other words, this: person.do_action(move).amount('5m').stop() Is better than: person.do_action().amount('5m').stop()