MCPcopy Index your code
hub / github.com/RustPython/RustPython / _localized_month

Class _localized_month

Lib/calendar.py:96–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94# fresh on each call, in case the user changes locale between calls.
95
96class _localized_month:
97
98 _months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
99 _months.insert(0, lambda x: "")
100
101 def __init__(self, format):
102 self.format = format
103
104 def __getitem__(self, i):
105 funcs = self._months[i]
106 if isinstance(i, slice):
107 return [f(self.format) for f in funcs]
108 else:
109 return funcs(self.format)
110
111 def __len__(self):
112 return 13
113
114
115class _localized_day:

Callers 1

calendar.pyFile · 0.85

Calls 2

dateMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected