mypy: Add Optional to tornado/descriptors.py; remove from mypy.ini.

This commit is contained in:
neiljp (Neil Pilgrim) 2018-10-27 01:07:32 +00:00 committed by Tim Abbott
parent d48fbb3f63
commit 482383b6f7
2 changed files with 1 additions and 4 deletions

View File

@ -115,9 +115,6 @@ strict_optional = False
[mypy-zerver.tornado.handlers] # Delayed setup of ASyncDjangoHandler._request_middleware (Optional), line 200 error
strict_optional = False
[mypy-zerver.tornado.descriptors] # line 10: 'get' can return None; only used in zerver/tornado/handlers?
strict_optional = False
# Tests (may be many issues in file; comment is just one error noted)
[mypy-zerver/tests/test_tornado] #202: error: Item "None" of "Optional[Morsel[Any]]" has no attribute "coded_value"

View File

@ -6,7 +6,7 @@ if False:
descriptors_by_handler_id = {} # type: Dict[int, ClientDescriptor]
def get_descriptor_by_handler_id(handler_id: int) -> 'ClientDescriptor':
def get_descriptor_by_handler_id(handler_id: int) -> Optional['ClientDescriptor']:
return descriptors_by_handler_id.get(handler_id)
def set_descriptor_by_handler_id(handler_id: int,