Repository: RasaHQ/rasa
Pull request: Update pytype version
Signed-off-by: ArthurTemporim <arthurrtl@gmail.com>

Fixes #3860

**Proposed changes**:
- Update pytype version from `2019.5.31` to `2019.7.11`.

**Status (please check what you already did)**:
- [x] made PR ready for code review
- [ ] added some tests for the functionality
- [ ] updated the documentation
- [x] updated the changelog
- [x] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa_nlu#code-style) for instructions)


Problem statement:
Update pytype version
With pytype version `2019.6.21`, the Travis build fails with the following error message:
```
[27/239] check rasa.core.channels.channel
FAILED: /home/travis/build/RasaHQ/rasa/.pytype/pyi/rasa/core/channels/channel.pyi 
pytype-single --imports_info /home/travis/build/RasaHQ/rasa/.pytype/imports/rasa.core.channels.channel.imports --module-name rasa.core.channels.channel -V 3.6 -o /home/travis/build/RasaHQ/rasa/.pytype/pyi/rasa/core/channels/channel.pyi --analyze-annotated --nofail --quick /home/travis/build/RasaHQ/rasa/rasa/core/channels/channel.py
File "/home/travis/build/RasaHQ/rasa/rasa/core/channels/channel.py", line 422, in stream: Name 'result' is not defined [name-error]
File "/home/travis/build/RasaHQ/rasa/rasa/core/channels/channel.py", line 425, in stream: Name 'result' is not defined [name-error]
```

With `2019.5.31`, however, it works correctly. The pytype version should be updated to `2019.6.21`, pinned, and all type checks should pass correctly.

Hints from issue discussion:
@federicotdn that's covered by https://github.com/RasaHQ/rasa/pull/3994 , isn't it?
https://github.com/RasaHQ/rasa/pull/3994 pins the pytype version, but does not update it.
@federicotdn I have updated the pytype version to `2019.7.11` and the error is the same. But I just added `result = None` [here](https://github.com/RasaHQ/rasa/blob/2d7092536aaadc130a33374c515b8529505b8b81/rasa/core/channels/channel.py#L414) and the error has gone locally. I created the brach [improve_pytype](https://github.com/RasaHQ/rasa/tree/improve_pytype) to verify if this error still exists on Travis.

Commit message: Merge branch 'master' of github.com:RasaHQ/rasa into improve_pytype

Patch to review:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index b9e780a4950e..c0cbe8573306 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -17,6 +17,7 @@ Changed
 -------
 - ``Agent.update_model()`` and ``Agent.handle_message()`` now work without needing to set a domain
   or a policy ensemble
+- Update pytype to ``2019.7.11``
 
 Removed
 -------
diff --git a/rasa/core/channels/channel.py b/rasa/core/channels/channel.py
index 65db38441774..240bfba07565 100644
--- a/rasa/core/channels/channel.py
+++ b/rasa/core/channels/channel.py
@@ -412,8 +412,9 @@ async def stream(resp: Any) -> None:
                     on_new_message, text, q, sender_id, input_channel
                 )
             )
+            result = None
             while True:
-                result = await q.get()  # pytype: disable=bad-return-type
+                result = await q.get()
                 if result == "DONE":
                     break
                 else:
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 8b8304d4a10a..8219eb003651 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -17,7 +17,7 @@ moto==1.3.8
 # lint/format/types
 black==19.3b0; python_version>='3.6'
 flake8==3.7.7
-pytype==2019.5.31
+pytype==2019.7.11
 
 # other
 google-cloud-storage==1.7.0


Code review comments:
diff_hunk: @@ -412,8 +412,9 @@ def stream_response(
                     on_new_message, text, q, sender_id, input_channel
                 )
             )
+            result = None
path: rasa/core/channels/channel.py
text: @user1:
```suggestion
            result = None  # declare variable up front to avoid pytype error
```