Skip to content

Instantly share code, notes, and snippets.

@k4ml
Created January 29, 2014 23:26
Show Gist options
  • Select an option

  • Save k4ml/8699461 to your computer and use it in GitHub Desktop.

Select an option

Save k4ml/8699461 to your computer and use it in GitHub Desktop.
POPO - Plain Old Python Object
class Messaging(object):
def __init__(self, user, sender, receiver, message):
self.user = user
self.sender = sender
self.receiver = receiver
self.message = message
def send(self):
required_points = self.get_required_points()
if required_points > self.user.points:
raise Exception('Not enough points')
return self.backend.send(self.sender, self.receiver, self.message)
@gabrielsimas
Copy link

I'm in 2024 and enjoying this thread. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment