-
Notifications
You must be signed in to change notification settings - Fork 3
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
Consistently use Python 3.10 type annotations #263
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #263 +/- ##
==========================================
- Coverage 92.61% 92.54% -0.07%
==========================================
Files 18 18
Lines 2044 2053 +9
==========================================
+ Hits 1893 1900 +7
- Misses 151 153 +2 ☔ View full report in Codecov by Sentry. |
name: str | None = None, | ||
output_processors: OutputProcessor | ||
| list[OutputProcessor] | ||
| None = output_processor_limit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a None did sneak in here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this change, output_processors
annotated with Optional[Union[OutputProcessor, List[OutputProcessor]]
.
If we convert the Optional
, this gives us:
Union[OutputProcessor, List[OutputProcessor] | None
.
If we now also covert the Union
and (List
to list
), this gives us OutputProcessor | list[OutputProcessor] | None
, which, afaict corresponds to the suggested change.
Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I missed a step in the chain of transformations.
] = output_processor_limit, | ||
output_processors: OutputProcessor | ||
| list[OutputProcessor] | ||
| None = output_processor_limit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Union[OutputProcessor, List[OutputProcessor]] | ||
] = output_processor_limit, | ||
ref2: DataReference | None = None, | ||
ref_value: Any = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical, but the change from optional any to any feels wrong. But probably is an issue that Any is too vague to start with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point. Do you suggestion yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no suggestion. Well, one, but it's quite vague. To create a type that reflects what a ref_value
can be. But it feels too much work for little gain.
No description provided.