| 94 | # fresh on each call, in case the user changes locale between calls. |
| 95 | |
| 96 | class _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 | |
| 115 | class _localized_day: |
no test coverage detected