Skip to content

Commit 4958ebf

Browse files
committed
use Text type where ever Union[str, unicode] is expected
1 parent d16a308 commit 4958ebf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

schema_salad/jsonld_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def pred(datatype, # type: Dict[str, Union[Dict, str]]
4040
# type: (...) -> Union[Dict, Text]
4141
split = urllib.parse.urlsplit(name)
4242

43-
vee = None # type: Optional[Union[str, Text]]
43+
vee = None # type: Optional[Text]
4444

4545
if split.scheme != '':
4646
vee = name
@@ -207,7 +207,7 @@ def fix_jsonld_ids(obj, # type: Union[Dict[Text, Any], List[Dict[Text, Any]]
207207
fix_jsonld_ids(entry, ids)
208208

209209

210-
def makerdf(workflow, # type: Union[str, Text]
210+
def makerdf(workflow, # type: Text
211211
wf, # type: Union[List[Dict[Text, Any]], Dict[Text, Any]]
212212
ctx, # type: ContextType
213213
graph=None # type: Graph

schema_salad/makedoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def table(self, header, body): # type: (Text, Text) -> Text
6060
) % (header, body)
6161

6262

63-
def to_id(text): # type: (Union[str, Text]) -> Union[str, Text]
63+
def to_id(text): # type: (Text) -> Text
6464
textid = text
6565
if text[0] in ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9"):
6666
try:
@@ -231,7 +231,7 @@ def typefmt(self,
231231
nbsp=False, # type: bool
232232
jsonldPredicate=None # type: Optional[Dict[str, str]]
233233
):
234-
# type: (...) -> Union[str, Text]
234+
# type: (...) -> Text
235235
if isinstance(tp, list):
236236
if nbsp and len(tp) <= 3:
237237
return "&nbsp;|&nbsp;".join([self.typefmt(n, redirects, jsonldPredicate=jsonldPredicate) for n in tp])

0 commit comments

Comments
 (0)