Skip to content

Commit c28dc0a

Browse files
Add annotations to api.py.
1 parent ae63851 commit c28dc0a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/rfc3986/api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .uri import URIReference
2323

2424

25-
def uri_reference(uri, encoding="utf-8"):
25+
def uri_reference(uri: str, encoding: str = "utf-8") -> URIReference:
2626
"""Parse a URI string into a URIReference.
2727
2828
This is a convenience function. You could achieve the same end by using
@@ -36,7 +36,7 @@ def uri_reference(uri, encoding="utf-8"):
3636
return URIReference.from_string(uri, encoding)
3737

3838

39-
def iri_reference(iri, encoding="utf-8"):
39+
def iri_reference(iri: str, encoding: str= "utf-8") -> IRIReference:
4040
"""Parse a IRI string into an IRIReference.
4141
4242
This is a convenience function. You could achieve the same end by using
@@ -50,7 +50,7 @@ def iri_reference(iri, encoding="utf-8"):
5050
return IRIReference.from_string(iri, encoding)
5151

5252

53-
def is_valid_uri(uri, encoding="utf-8", **kwargs):
53+
def is_valid_uri(uri: str, encoding: str = "utf-8", **kwargs: bool) -> bool:
5454
"""Determine if the URI given is valid.
5555
5656
This is a convenience function. You could use either
@@ -75,7 +75,7 @@ def is_valid_uri(uri, encoding="utf-8", **kwargs):
7575
return URIReference.from_string(uri, encoding).is_valid(**kwargs)
7676

7777

78-
def normalize_uri(uri, encoding="utf-8"):
78+
def normalize_uri(uri: str, encoding: str = "utf-8") -> str:
7979
"""Normalize the given URI.
8080
8181
This is a convenience function. You could use either
@@ -91,7 +91,7 @@ def normalize_uri(uri, encoding="utf-8"):
9191
return normalized_reference.unsplit()
9292

9393

94-
def urlparse(uri, encoding="utf-8"):
94+
def urlparse(uri: str, encoding: str = "utf-8") -> ParseResult:
9595
"""Parse a given URI and return a ParseResult.
9696
9797
This is a partial replacement of the standard library's urlparse function.

0 commit comments

Comments
 (0)