This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: TextCalendar.formatmonth is not influenced by setfirstweekday
Type: behavior Stage:
Components: Documentation Versions: Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: doerwalter Nosy List: doerwalter, mft
Priority: normal Keywords: easy

Created on 2008-02-06 09:42 by mft, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg62090 - (view) Author: MATSUI Tetsushi (mft) Date: 2008-02-06 09:41
TextCalendar.formatmonth is not influenced by setfirstweekday,
but the argument of constructor.

Documentation:
Depends on the first weekday as set by setfirstweekday().

actual behavior:
>>> cal0 = calendar.TextCalendar()
>>> print cal0.formatmonth(2008, 2)
   February 2008
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29

>>> calendar.setfirstweekday(4)
>>> print cal0.formatmonth(2008, 2)
   February 2008
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29
msg62096 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2008-02-06 14:47
setfirstweekday() isn't supposed to have any influence on calendar
objects created explicitely. The function setfirstweekday() is only for
the module level interface. The documentation is wrong here. However you
*can* change the first weekday with the setfirstweekday() *method*.
msg62100 - (view) Author: MATSUI Tetsushi (mft) Date: 2008-02-06 15:24
Thank you for the clarification.
But then, where is the documentation about the setfirstweekday() method?
msg62103 - (view) Author: MATSUI Tetsushi (mft) Date: 2008-02-06 16:25
There is another wrong documentation about firstweekday. 
In the part of Calendar.iterweekdays, a method "firstweekday" appered.
But indeed it means the method "getfirstweekday()", since firstweekday
is merely an uncallable integer attribute of Calendar objects.
msg62173 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2008-02-07 19:36
The doccumentation is
here:http://docs.python.org/dev/library/calendar.html#calendar.TextCalendar.formatmonth
(or in Doc/library/calendar.rst in the source).

Anyway the first of those documentation bugs is fixed now in r60649
(trunk) and r60650 (release25-maint).
msg62175 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2008-02-07 19:56
You're supposed to use firstweekday as a property instead of using the
getter method getfirstweekday(). Anyway this is fixed now in r60651
(trunk) and r60652 (release25-maint)
msg62191 - (view) Author: MATSUI Tetsushi (mft) Date: 2008-02-08 01:06
In the message msg62100, I asked about the place of *setfirstweekday()*.
Your answer in the message msg62173 was about *formatmonth()*.
I don't think the fix is complete until some explanations are given for
firstweekday and/or its getter/setter, since they have been mentioned
from your description fixes but have no entries.
History
Date User Action Args
2022-04-11 14:56:30adminsetgithub: 46302
2008-02-08 01:06:58mftsetmessages: + msg62191
2008-02-07 19:56:17doerwaltersetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg62175
2008-02-07 19:36:23doerwaltersetmessages: + msg62173
2008-02-06 16:25:54mftsetmessages: + msg62103
2008-02-06 15:24:24mftsetmessages: + msg62100
2008-02-06 14:47:12doerwaltersetassignee: doerwalter
resolution: accepted
messages: + msg62096
nosy: + doerwalter
2008-02-06 12:08:39christian.heimessetpriority: normal
keywords: + easy
type: behavior
2008-02-06 09:42:00mftcreate