{"record":{"id":"4537e6be14bdb829","repo":"matplotlib/matplotlib","slug":"unexpected-type-passed-to-self-r","errorCode":null,"errorMessage":"Unexpected type passed to {self!r}.","messagePattern":"Unexpected type passed to (.+?)\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/matplotlib/dates.py","lineNumber":938,"sourceCode":"        self._locator = locator\n\n    def __call__(self, x, pos=None):\n        try:\n            locator_unit_scale = float(self._locator._get_unit())\n        except AttributeError:\n            locator_unit_scale = 1\n        # Pick the first scale which is greater than the locator unit.\n        fmt = next((fmt for scale, fmt in sorted(self.scaled.items())\n                    if scale >= locator_unit_scale),\n                   self.defaultfmt)\n\n        if isinstance(fmt, str):\n            self._formatter = DateFormatter(fmt, self._tz, usetex=self._usetex)\n            result = self._formatter(x, pos)\n        elif callable(fmt):\n            result = fmt(x, pos)\n        else:\n            raise TypeError(f'Unexpected type passed to {self!r}.')\n\n        return result\n\n\nclass rrulewrapper:\n    \"\"\"\n    A simple wrapper around a `dateutil.rrule` allowing flexible\n    date tick specifications.\n    \"\"\"\n    def __init__(self, freq, tzinfo=None, **kwargs):\n        \"\"\"\n        Parameters\n        ----------\n        freq : {YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY}\n            Tick frequency. These constants are defined in `dateutil.rrule`,\n            but they are accessible from `matplotlib.dates` as well.\n        tzinfo : `datetime.tzinfo`, optional\n            Time zone information. The default is None.","sourceCodeStart":920,"sourceCodeEnd":956,"githubUrl":"https://github.com/matplotlib/matplotlib/blob/b379c1b69e012b142c0f496a52bcb30513802d72/lib/matplotlib/dates.py#L920-L956","documentation":"Error \"Unexpected type passed to {self!r}.\" thrown in matplotlib/matplotlib.","triggerScenarios":"Thrown at lib/matplotlib/dates.py:938 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b379c1b69e012b142c0f496a52bcb30513802d72","analyzedAt":"2026-08-21T23:31:55.468Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}