Skip to content

Commit 821f62b

Browse files
committed
Tighten the typehint for parseutils.
1 parent a5350f0 commit 821f62b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

litecli/packages/parseutils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import re
4-
from typing import Generator, Iterable
4+
from typing import Generator, Iterable, Literal
55

66
import sqlparse
77
from sqlparse.sql import IdentifierList, Identifier, Function, Token, TokenList
@@ -19,7 +19,9 @@
1919
}
2020

2121

22-
def last_word(text: str, include: str = "alphanum_underscore") -> str:
22+
def last_word(
23+
text: str, include: Literal["alphanum_underscore", "many_punctuations", "most_punctuations", "all_punctuations"] = "alphanum_underscore"
24+
) -> str:
2325
R"""
2426
Find the last word in a sentence.
2527

0 commit comments

Comments
 (0)