Skip to content

Correct type annotations for original_path#1258

Open
dhdaines wants to merge 2 commits intomasterfrom
issue-1180
Open

Correct type annotations for original_path#1258
dhdaines wants to merge 2 commits intomasterfrom
issue-1180

Conversation

@dhdaines
Copy link
Copy Markdown
Contributor

Fixes: #1180

As mentioned in that issue, the type annotation for the original_path attribute of LTCurve doesn't correspond to the actual data structure. This is maybe a bad thing for people who use type checkers 😉

This makes it very type-safe, with actual literals for the operators. Unfortunately mypy doesn't yet know how to narrow this properly, but it may be useful in the future.

How Has This Been Tested?

By running mypy on the code.

Checklist

  • I have read CONTRIBUTING.md.
  • I have added a concise human-readable description of the change to CHANGELOG.md.
  • I have tested that this fix is effective or that this feature works.
  • I have added docstrings to newly created methods and classes.
  • I have updated the README.md and the readthedocs documentation. Or verified that this is not necessary.

@dhdaines dhdaines requested a review from pietermarsman March 13, 2026 13:42
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.

original_path attribute on LTCurve has incorrect type annotation (or is just incorrect)

1 participant