Holidays: added cmp() for Python3
This commit is contained in:
parent
a86890002f
commit
448ddfd721
@ -404,7 +404,7 @@
|
||||
<date name="Ash Wednesday" value="> easter(y)" type="religious" offset="-46" />
|
||||
<date name="Mardi Gras" value="> easter(y)" type="religious" offset="-47" />
|
||||
<date name="Daylight Saving begins" value="> dst(y)[0]" type="informational" />
|
||||
<date name="Income Taxes due" value="*/4/15" type="national" if="date.weekday().__cmp__(4)-1" />
|
||||
<date name="Income Taxes due" value="*/4/15" type="national" if="cmp(date.weekday(),4)-1"/>
|
||||
<date name="Income Taxes due" value="*/4/16" type="national" if="date.weekday() == 0" />
|
||||
<date name="Income Taxes due" value="*/4/17" type="national" if="date.weekday() == 0" />
|
||||
<date name="Daylight Saving ends" value="> dst(y)[1]" type="informational" />
|
||||
|
@ -138,6 +138,12 @@ def dow(y, m, d):
|
||||
""" Return the ISO day of week for the given year, month and day. """
|
||||
return datetime.date(y, m, d).isoweekday()
|
||||
|
||||
def cmp(a, b):
|
||||
"""
|
||||
Replacement for older Python's cmp.
|
||||
"""
|
||||
return (a > b) - (a < b)
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
# HolidayTable
|
||||
|
Loading…
Reference in New Issue
Block a user