8000 Add missing Optional type annotation · python-semver/python-semver@98e845c · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 98e845c

Browse files
committed
Add missing Optional type annotation
1 parent f7a6eda commit 98e845c

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/semver/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
"""
1212
import os.path
1313
import sys
14-
from typing import List
14+
from typing import List, Optional
1515

1616
from semver import cli
1717

1818

19-
def main(cliargs: List[str] = None) -> int:
19+
def main(cliargs: Optional[List[str]] = None) -> int:
2020
if __package__ == "":
2121
path = os.path.dirname(os.path.dirname(__file__))
2222
sys.path[0:0] = [path]

src/semver/_deprecated.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@
77
import warnings
88
from functools import partial, wraps
99
from types import FrameType
10-
from typing import Type, Callable, cast
10+
from typing import Type, Callable, Optional, cast
1111

1212
from . import cli
1313
from .version import Version
1414
from ._types import Decorator, F, String
1515

1616

1717
def deprecated(
18-
func: F = None,
19-
replace: str = None,
20-
version: str = None,
18+
func: Optional[F] = None,
19+
replace: Optional[str] = None,
20+
version: Optional[str] = None,
2121
category: Type[Warning] = DeprecationWarning,
2222
) -> Decorator:
2323
"""

src/semver/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import argparse
1414
import sys
15-
from typing import cast, List
15+
from typing import cast, List, Optional
1616

1717
from .version import Version
1818
from .__about__ import __version__
@@ -152,7 +152,7 @@ def process(args: argparse.Namespace) -> str:
152152
return args.func(args)
153153

154154

155-
def main(cliargs: List[str] = None) -> int:
155+
def main(cliargs: Optional[List[str]] = None) -> int:
156156
"""
157157
Entry point for the application script.
158158

src/semver/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def __init__(
107107
major: SupportsInt,
108108
minor: SupportsInt = 0,
109109
patch: SupportsInt = 0,
110-
prerelease: Union[String, int] = None,
111-
build: Union[String, int] = None,
110+
prerelease: Optional[Union[String, int]] = None,
111+
build: Optional[Union[String, int]] = None,
112112
):
113113
# Build a dictionary of the arguments except prerelease and build
114114
version_parts = {"major": int(major), "minor": int(minor), "patch": int(patch)}

0 commit comments

Comments
 (0)
0