1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

remove unneeded optional

This commit is contained in:
Kelly Brazil
2022-02-01 17:18:55 -08:00
parent a15a1967dc
commit 96ec70de4f
2 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
import string
from typing import List, Dict, Optional
from typing import List, Dict
def simple_table_parse(data: List[str]) -> List[Dict]:
@ -33,7 +33,7 @@ def simple_table_parse(data: List[str]) -> List[Dict]:
return raw_output
def sparse_table_parse(data: List[str], delim: Optional[str] ='\u2063') -> List[Dict]:
def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict]:
"""
Parse tables with missing column data or with spaces in column data.
@ -96,7 +96,7 @@ def sparse_table_parse(data: List[str], delim: Optional[str] ='\u2063') -> List[
h_end -= 1
# insert custom delimiter
entry = f'{entry[:h_end]}{delim}{entry[h_end + 1:]}'
entry = entry[:h_end] + delim + entry[h_end + 1:]
# create the entry list from the new custom delimiter
entry_list = entry.split(delim, maxsplit=len(header_list) - 1)

View File

@ -5,7 +5,7 @@ import locale
import shutil
from datetime import datetime, timezone
from textwrap import TextWrapper
from typing import Dict, Iterable, List, Union, Optional
from typing import Dict, Iterable, List, Union
def warning_message(message_lines: List[str]) -> None:
@ -76,7 +76,7 @@ def error_message(message_lines: List[str]) -> None:
print(message, file=sys.stderr)
def compatibility(mod_name: str, compatible: List, quiet: Optional[bool] = False) -> None:
def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None:
"""
Checks for the parser's compatibility with the running OS
platform.