Skip to content

Commit

Permalink
mypy: set no_implicit_optional
Browse files Browse the repository at this point in the history
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
- python/mypy#9091

Change-Id: Ie3301798462a89af9fc0053070055a77a2437415
  • Loading branch information
eharney committed Aug 23, 2022
1 parent 25756c1 commit aa97f44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions os_brick/initiator/connectors/base_rbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,7 +37,7 @@ def _sanitize_host(host: str) -> str:
@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')
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ warn_unused_ignores = true
show_error_codes = true
pretty = true
html_report = mypy-report
no_implicit_optional = true

0 comments on commit aa97f44

Please sign in to comment.