We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crossandra.tokenize
Right now the method is declared to return list[Enum | Any] where:
list[Enum | Any]
Enum
__init__
Any
It feels like both things could be improved with generics.
Here are some (hopefully relevant) highlights of their origin:
def invert_enum(enum: type[Enum]) -> dict[str, Enum]: ... class Empty(Enum): pass class Crossandra: def __init__( self, token_source: type[Enum] = Empty, *, ... rules: list[Rule[Any] | RuleGroup] | None = None, ... ) -> None: self.__rules: list[Rule[Any]] = [] for r in rules or []: if isinstance(r, RuleGroup): self.__rules.extend(r) else: self.__rules.append(r) ... self.__tokens = invert_enum(token_source) ... def tokenize(self, code: str) -> list[Enum | Any]: ...
Solving #16 is likely to help here.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Right now the method is declared to return
list[Enum | Any]
where:Enum
refers to the token_source enum members (probably not specific to the one specified in the__init__
?)Any
refers to anything that the rules supplied to the tokenizer returnIt feels like both things could be improved with generics.
Here are some (hopefully relevant) highlights of their origin:
Solving #16 is likely to help here.
The text was updated successfully, but these errors were encountered: