[Patches] [ python-Patches-485794 ] calendar.isleap should return 1 not true

noreply@sourceforge.net noreply@sourceforge.net
Mon, 26 Nov 2001 14:04:38 -0800


Patches item #485794, was opened at 2001-11-26 14:04
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=485794&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stefan Schwarzer (sschwarzer)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: calendar.isleap should return 1 not true

Initial Comment:
The documentation for calendar.isleap should state the function returns 1, not only true.

The documentation says only that calendar.isleap returns true if the year is a leap year. The docstring 
is more specific and speaks of 1 vs. 0. The latter is convenient for

days_in_february = 28 + calendar.isleap(year)

However, if the docstring describes only the - possibly changing - implementation you would strictly 
have to write the much more verbose

if calendar.isleap(year):
    days_in_february = 29
else:
    days_in_february = 28

(Is the actual interface of calendar.isleap going to change? (I don't think so.))

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=485794&group_id=5470