From a49791750a32657baa6e70cfc95de580c7b29070 Mon Sep 17 00:00:00 2001 From: Crista Lopes Date: Fri, 29 Nov 2013 20:38:35 -0800 Subject: [PATCH] Make the constructor take a func already --- 25-quarantine/tf-25.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/25-quarantine/tf-25.py b/25-quarantine/tf-25.py index b62124e..5da4590 100644 --- a/25-quarantine/tf-25.py +++ b/25-quarantine/tf-25.py @@ -5,8 +5,8 @@ import sys, re, operator, string # The Quarantine class for this example # class TFQuarantine: - def __init__(self): - self._funcs = [] + def __init__(self, func): + self._funcs = [func] def bind(self, func): self._funcs.append(func) @@ -68,7 +68,6 @@ def top25_freqs(word_freqs): # # The main function # -quarantine = TFQuarantine() -quarantine.bind(get_input).bind(extract_words).bind(remove_stop_words).bind(frequencies).bind(sort).bind(top25_freqs) +quarantine = TFQuarantine(get_input).bind(extract_words).bind(remove_stop_words).bind(frequencies).bind(sort).bind(top25_freqs) quarantine.execute()