Skip to content
New issue

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

Added some typing #13

Closed
wants to merge 1 commit into from
Closed

Conversation

KOLANICH
Copy link

@KOLANICH KOLANICH commented Dec 1, 2021

Fixes #12

@soxofaan
Copy link
Owner

soxofaan commented Dec 1, 2021

Hi @KOLANICH thanks for the PR!
I'll try to address it later this week when I find some time

@soxofaan
Copy link
Owner

soxofaan commented Dec 2, 2021

I already cherrypicked the basic annotations

I'm not a big fan of these type aliases

SymElementT = Union[str, int, bytes]
SymT = Union[Tuple[SymElementT, ...], SymElementT, "_EndOfFileSymbol"]
CodeT = Tuple[int, ...]
CodeTableT = Dict[SymT, CodeT]
SymTSeq = Iterable[SymT]

I would rather prefer to introduce some real (thin) containers (like namedtuples) instead of these cryptic aliases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply type annotations everywhere (in a 3.4-compatible way)
2 participants