mypy: Annotate helloworld bot.
MODIFY
zulip_bots/zulip_bots/bots/helloworld/helloworld.py
zulip_bots/zulip_bots/bots/helloworld/helloworld.py
# See readme.md for instructions on running this code.
+from typing import Any
class HelloWorldHandler(object):
- def usage(self):
+ def usage(self) -> str:
return '''
This is a boilerplate bot that responds to a user query with
"beep boop", which is robot for "Hello World".
@@ -11,8 +12,8 @@ class HelloWorldHandler(object):
sophisticated, bots.
'''
- def handle_message(self, message, bot_handler):
- content = 'beep boop'
+ def handle_message(self, message: Any, bot_handler: Any) -> None:
+ content = 'beep boop' # type: str
bot_handler.send_reply(message, content)
handler_class = HelloWorldHandler

MODIFY
zulip_bots/zulip_bots/bots/helloworld/test_helloworld.py
zulip_bots/zulip_bots/bots/helloworld/test_helloworld.py
from zulip_bots.test_lib import StubBotTestCase
class TestHelpBot(StubBotTestCase):
- bot_name = "helloworld"
+ bot_name = "helloworld" # type: str
- def test_bot(self):
+ def test_bot(self) -> None:
dialog = [
('', 'beep boop'),
('help', 'beep boop'),

mypy: Annotate helloworld bot.