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