date(year=None, month=None, day=None) -> date
| 977 | ################################################################################ |
| 978 | |
| 979 | class date(datetime.date): |
| 980 | |
| 981 | "date(year=None, month=None, day=None) -> date" |
| 982 | |
| 983 | __slots__ = _slots() |
| 984 | |
| 985 | def __new__(cls, year=None, month=None, day=None): |
| 986 | "Creates a customized date object that does not require arguments." |
| 987 | if year is None: |
| 988 | year, month, day = cls.max.year, cls.max.month, cls.max.day |
| 989 | elif isinstance(year, bytes): |
| 990 | year_high, year_low, month, day = year |
| 991 | year = (year_high << 8) + year_low |
| 992 | return super().__new__(cls, year, month, day) |
| 993 | |
| 994 | def __str__(self): |
| 995 | return self.strftime('%d-%b-%Y').upper() |
| 996 | |
| 997 | def __format__(self, length): |
| 998 | return str(self).ljust(int(length)) |
| 999 | |
| 1000 | ################################################################################ |
| 1001 |