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

2024-Q3: Code climate #1912

Open
2 of 38 tasks
stanislaw opened this issue Jul 7, 2024 · 0 comments
Open
2 of 38 tasks

2024-Q3: Code climate #1912

stanislaw opened this issue Jul 7, 2024 · 0 comments

Comments

@stanislaw
Copy link
Collaborator

stanislaw commented Jul 7, 2024

Previous: #1770
Next: TBD



        pygmented_source_file_lines: List[Union[str, RangeMarkerTuple]] = list(

This is for mypy... Honestly I don't understand why we have to make a list()-copy of pygmented_source_file_content.split("\n"). Without list(), mypy would claim

error: Incompatible types in assignment (expression has type "List[str]", variable has type "List[Union[str, RangeMarkerTuple]]")

I know assignment would be a problem without explicit annotation of pygmented_source_file_lines because of list invariance. But the annotation is there... why do we still need list()?

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

No branches or pull requests

1 participant