pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/faif/python-patterns/commit/e8343854455ca2a00268571a31de7ea60931f029

a.css" /> Retry · faif/python-patterns@e834385 · GitHub
Skip to content

Commit e834385

Browse files
committed
Retry
1 parent 9ad7206 commit e834385

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

patterns/other/blackboard.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from abc import ABC, abstractmethod
1313
import random
1414

15+
1516
class AbstractExpert(ABC):
1617
"""Abstract class for experts in the blackboard system."""
1718
@abstractmethod
@@ -20,18 +21,18 @@ def __init__(self, blackboard) -> None:
2021

2122
@property
2223
@abstractmethod
23-
def is_eager_to_contribute(self):
24+
def is_eager_to_contribute(self) -> bool:
2425
raise NotImplementedError("Must provide implementation in subclass.")
2526

2627
@abstractmethod
27-
def contribute(self):
28+
def contribute(self) -> None:
2829
raise NotImplementedError("Must provide implementation in subclass.")
2930

3031

3132
class Blackboard:
3233
"""The blackboard system that holds the common state."""
3334
def __init__(self) -> None:
34-
self.experts = []
35+
self.experts: list = [AbstractExpert]
3536
self.common_state = {
3637
"problems": 0,
3738
"suggestions": 0,
@@ -138,7 +139,7 @@ def main():
138139

139140

140141
if __name__ == "__main__":
141-
random.seed(1234) # for deterministic doctest outputs
142+
#random.seed(1234) # for deterministic doctest outputs
142143
import doctest
143144

144145
doctest.testmod()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy