diff --git a/wolframalpha/__init__.py b/wolframalpha/__init__.py index b2e0695..d715750 100644 --- a/wolframalpha/__init__.py +++ b/wolframalpha/__init__.py @@ -140,12 +140,16 @@ class Pod(ErrorHandler, object): return self.number_of_subpods @property - def text(self): + def texts(self): """ - Simply get the text from each subpod in this pod and return it in a list. + The text from each subpod in this pod as a list. """ return [subpod.text for subpod in self.subpods] + @property + def text(self): + return next(iter(self)).text + class Subpod(object): """ diff --git a/wolframalpha/test_client.py b/wolframalpha/test_client.py index 4ce9756..c017d6f 100644 --- a/wolframalpha/test_client.py +++ b/wolframalpha/test_client.py @@ -27,7 +27,7 @@ def test_basic(API_key): res = client.query('30 deg C in deg F') assert len(res.pods) > 0 results = list(res.results) - assert results[0].text == ['86 °F (degrees Fahrenheit)'] + assert results[0].text == '86 °F (degrees Fahrenheit)' def test_invalid_app_id(): client = wolframalpha.Client('abcdefg')