Sayers 0 ▲ ronjeffries.com 1 hour ago · 5 min read1032 words · Tech · hide · 0 comments Hello, loves! Tout le monde déteste l’IA. I feel some tiny objects coming on. I plan to let them come. Tiny objects FTW. I’m tentatively planning some hand objects for Denizens that say things. I have a few notions in mind: A sequence of sayings that are spoken once to the end and then the last one repeats if more requests are made. A sequence that cycles from beginning to end to beginning to end. A sequence that produces a random saying at each reference. A wrapper for the above that prefixes the string with a name and quotes the text. Begin with a test. class TestSaying: def test_say_sequence(self): seq = SequenceSayer(['a', 'b', 'c']) assert seq.saying == 'a' assert seq.saying == 'b' assert seq.saying == 'c' assert seq.saying == 'c' And a class. class SequenceSayer: def __init__(self, messages): self.messages = messages self.index = 0 @property def saying(self): message = self.messages[self.index] self.index = min(self.index + 1, len(self.messages)-1) return message And a test: def… No comments yet. Log in to reply on the Fediverse. Comments will appear here.