Re: [Tutor] question about calendar module in standard libriary

2017-09-11 Thread Peter Otten
Айнур Зулькарнаев wrote: > Hello all! > > > There is a class Calendar in calendar.py in standard libriary. > > > class Calendar(object): > """ > Base calendar class. This class doesn't do any formatting. It > simply provides data to subclasses. > """ > >

Re: [Tutor] question about calendar module in standard libriary

2017-09-11 Thread Steven D'Aprano
On Mon, Sep 11, 2017 at 10:58:51AM +, Айнур Зулькарнаев wrote: > class Calendar(object): > def __init__(self, firstweekday=0): > self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday > > def getfirstweekday(self): > return self._firstweekday % 7 > > def setfir

Re: [Tutor] question about calendar module in standard libriary

2017-09-11 Thread Alan Gauld via Tutor
On 11/09/17 11:58, Айнур Зулькарнаев wrote: > So, the question is why not explicitly raise ValueError if > user enters the firstweekday parameter bigger that 6 Its a valid question but you probably need to find the original PEP document to find the answer and that module has been around for a *

[Tutor] question about calendar module in standard libriary

2017-09-11 Thread Айнур Зулькарнаев
Hello all! There is a class Calendar in calendar.py in standard libriary. class Calendar(object): """ Base calendar class. This class doesn't do any formatting. It simply provides data to subclasses. """ def __init__(self, firstweekday=0): self.f