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

Completely type win32timezone #2334

Merged
merged 18 commits into from
Jan 4, 2025
Merged

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jul 27, 2024

I plan on bringing RangeMap improvements over to jaraco.collections. Edit: jaraco/jaraco.collections#16

CC @jaraco

@Avasam Avasam requested review from mhammond and jaraco July 27, 2024 04:07
win32/Lib/win32timezone.py Outdated Show resolved Hide resolved
win32/Lib/win32timezone.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@jaraco jaraco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been forever since I've touched this code and it was my first meaningful open source contribution in Python, so I'm sure it has some crufty approaches. Thanks for modernizing it.

Comment on lines -684 to -747
def __le__(self, other):
return self.__dict__ < other.__dict__
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #1990 I updated __cmp__ for __le__, but that doesn't make sense for dicts. Comparisons of TimeZoneInfo has been broken since Python 3 anyway so removing this doesn't remove any functionality.

@Avasam Avasam marked this pull request as draft July 27, 2024 21:53
Comment on lines 936 to +945
"""Resolve a multilingual user interface resource for the time zone name

spec should be of the format @path,-stringID[;comment]
see http://msdn2.microsoft.com/en-us/library/ms725481.aspx for details

>>> import sys
>>> result = resolveMUITimeZone('@tzres.dll,-110')
>>> expectedResultType = [type(None),str][sys.getwindowsversion() >= (6,)]
>>> type(result) is expectedResultType
True
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Avasam Avasam marked this pull request as ready for review October 15, 2024 02:44
@Avasam
Copy link
Collaborator Author

Avasam commented Dec 14, 2024

@mhammond Now that #2337 and #2339 are merged this should be easier to review. But I can further split non-annotations changes if you'd like.

Copy link
Owner

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, this is fantastic, thank you!

@Avasam Avasam merged commit 44de287 into mhammond:main Jan 4, 2025
30 checks passed
@Avasam Avasam deleted the type-win32timezone branch January 4, 2025 21:34
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.

3 participants