Remove silx.gui.plot._utils.timestamp and future annotations#4630
Merged
Conversation
c917531 to
61ac22d
Compare
loichuder
commented
Jun 19, 2026
| _EPOCH = dt.datetime(1970, 1, 1, tzinfo=dateutil.tz.tzutc()) | ||
|
|
||
|
|
||
| def timestamp(dtObj): |
Member
Author
There was a problem hiding this comment.
timestamp is available on datetime objects since Python 3.3: https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp
| """ | ||
|
|
||
| def __init__(self, parent: qt.Qwidget | None = None): | ||
| def __init__(self, parent: qt.QWidget | None = None): |
Member
Author
There was a problem hiding this comment.
Removing from __future__ import annotations allowed to catch this typo in the type hint
922381d to
30ca08d
Compare
30ca08d to
d2e12e8
Compare
d2e12e8 to
107250c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
<Module or Topic>: <Action> <Summary>(see contributing guidelines)PR summary
Fix #4235
There is still some mention to Python 2.7 in very specific code (e.g.
EdfFile). To be discussed if we want to remove it.from __future__ import annotationsis actually still needed if the class name is used as a type hint before the class is defined (forward references, present in e.g.colors,PlotWidget). This is because the lazy evaluation of annotations is only implemented in Python 3.14 (https://peps.python.org/pep-0749/), even though thefrom __future__ import annotationsbehaviour dates as far as Python 3.7 (https://peps.python.org/pep-0563/).Instead of keeping
from __future__ import annotationsin only a few files, I converted the forward references to string annotations (doing explicitely whatfrom __future__is doing) where needed.AI Disclosure
from __future__ import annotations