Completely type win32timezone#2334
Conversation
jaraco
left a comment
There was a problem hiding this comment.
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.
| def __le__(self, other): | ||
| return self.__dict__ < other.__dict__ |
There was a problem hiding this comment.
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.
| """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 |
There was a problem hiding this comment.
I had accidentally removed a bit too much in https://github.com/mhammond/pywin32/pull/2085/files#diff-e5d2b4683af028d6a25d25c862c248214190080072e6f07171106c56dd7812dc
…into type-win32timezone
mhammond
left a comment
There was a problem hiding this comment.
Sorry for the delay, this is fantastic, thank you!
*args/*kwargsparams)TimeZoneInfo.tzname(see Fix bugs in TimeZoneInfo.tzname #2337).RangeMapfromjaraco.collections& MadeRangeMapgenerictznamehandlesNoneparam as per the official docFixedFixTimeZoneDefinitioncreation from aTIME_ZONE_INFORMATIONorDYNAMIC_TIME_ZONE_INFORMATION(used to crash):win32timezone.TimeZoneInfo.__init_from_otherand added tests #2339I plan on bringing
RangeMapimprovements over tojaraco.collections. Edit: jaraco/jaraco.collections#16CC @jaraco