Skip to content

Commit

Permalink
Reflow long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoliaw committed Jul 24, 2023
1 parent 30c6a29 commit a7dc12d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/tickit/adapters/interpreters/command/regex_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ class RegexCommand(Generic[AnyStr]):
convert: Callable[[bytes], AnyStr] = field(init=False)

def __post_init__(self, regex: AnyStr, format: Optional[str]):
# The type checking fails here as it can't determine that the return type matches the
# regex type. The isinstance should narrow the AnyStr type but doesn't
# The type checking fails here as it can't determine that the return
# type matches the regex type. The isinstance should narrow the AnyStr
# type but doesn't
if isinstance(regex, str):
if format is None:
raise ValueError(
Expand Down
3 changes: 2 additions & 1 deletion src/tickit/utils/configuration/tagged_union.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def __init_subclass__(cls) -> None:
# be identified when deserializing.
cls.__annotations__ = {
**getattr(cls, "__annotations__", {}),
# Literal is supposed to only accept literal strings but we need to set it dynamically
# Literal is supposed to only accept literal strings but we need to
# set it dynamically
discriminator: Literal[cls_name], # type: ignore
}
setattr(cls, discriminator, field(default=cls_name, repr=False))
Expand Down

0 comments on commit a7dc12d

Please sign in to comment.