Closed
Description
The following error message is triggered when by adding -> Dict[Text, Any]
to the type signature:
/tmp/pod.py:7: error: Need type annotation for 'result'
This is the contents of /tmp/pod.py
:
import collections
from typing import Any, Dict, Text
class PlainOldData:
def as_json_dict(self) -> Dict[Text, Any]:
result = collections.OrderedDict()
for k in self.__slots__:
value = getattr(self, k)
if value is not None:
result[k] = value
return result