MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / rate

Method rate

example_code/item_081.py:125–127  ·  view source on GitHub ↗
(self, rating)

Source from the content-addressed store, hash-verified

123 self.ratings = []
124
125 def rate(self, rating):
126 assert 0 < rating <= self.max_rating, f"Invalid {rating=}"
127 self.ratings.append(rating)
128
129
130print("Example 8")

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected