MCPcopy Create free account
hub / github.com/ActiveState/code / date

Class date

recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py:979–998  ·  view source on GitHub ↗

date(year=None, month=None, day=None) -> date

Source from the content-addressed store, hash-verified

977################################################################################
978
979class 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

Callers 8

dateMethod · 0.70
test_date_functionalityFunction · 0.70
test_column_functionsFunction · 0.70
getEpsFunction · 0.50
calc_easterFunction · 0.50
calc_easterMethod · 0.50
init_calendarMethod · 0.50
monday_of_week_oneFunction · 0.50

Calls 1

_slotsFunction · 0.85

Tested by 2

test_date_functionalityFunction · 0.56
test_column_functionsFunction · 0.56