def get_bill(self, id): with self.browser: bill = self.browser.get_bill(id) if bill: return bill else: raise BillNotFound()
def get_bill(self, id): bill = self.browser.get_bill(id) if not bill: raise BillNotFound() else: return bill
def get_bill(self, id): subscription = self.get_subscription(id.split('-')[0]) for bill in self.browser.get_bills(subscription): if bill.id == id: return bill raise BillNotFound()