mypy: set no_implicit_optional

The current version of PEP-484 indicates that
type checkers should not allow implicit optional
parameters.

- https://www.python.org/dev/peps/pep-0484/#union-types
- https://github.com/python/mypy/issues/9091

Change-Id: Ie3301798462a89af9fc0053070055a77a2437415
This commit is contained in:
Eric Harney committed 2022-08-23 15:11:56 +00:00
1 parent 25756c1279
commit aa97f4455c
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -15,7 +15,7 @@
from __future__ import annotations
from typing import Any
from typing import Any, Optional # noqa: H301
from oslo_log import log as logging
from oslo_utils import netutils
@@ -37,7 +37,7 @@ class RBDConnectorMixin(object):
@classmethod
def _get_rbd_args(cls,
connection_properties: dict[str, Any],
conf: str = None) -> list[str]:
conf: Optional[str] = None) -> list[str]:
user = connection_properties.get('auth_username')
monitor_ips = connection_properties.get('hosts')
monitor_ports = connection_properties.get('ports')
+1
View File
@@ -48,3 +48,4 @@ warn_unused_ignores = true
show_error_codes = true
pretty = true
html_report = mypy-report
no_implicit_optional = true