{"record":{"id":"6671f98d08e24162","repo":"pola-rs/polars","slug":"type-self-name-object-has-no-attribute-n","errorCode":null,"errorMessage":"'{type(self).__name__}' object has no attribute {name!r}. Did you mean: {matches[0]!r}?","messagePattern":"'(.+?)' object has no attribute (.+?)\\. Did you mean: (.+?)\\?","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/_utils/various.py","lineNumber":756,"sourceCode":"            f\"expected `other` to be a {qualified_type_name(current)!r}, \"\n            f\"not {qualified_type_name(other)!r}\"\n        )\n        raise TypeError(msg)\n\n\nclass _NamespaceSuggestMixin:\n    \"\"\"Mixin that adds suggestions to AttributeError on namespace typos.\"\"\"\n\n    def __getattr__(self, name: str) -> NoReturn:\n        import difflib\n\n        public = [m for m in dir(type(self)) if not m.startswith(\"_\")]\n        matches = difflib.get_close_matches(name, public, n=1, cutoff=0.6)\n        if matches:\n            msg = f\"'{type(self).__name__}' object has no attribute {name!r}. Did you mean: {matches[0]!r}?\"\n        else:\n            msg = f\"'{type(self).__name__}' object has no attribute {name!r}\"\n        raise AttributeError(msg)\n","sourceCodeStart":738,"sourceCodeEnd":757,"githubUrl":"https://github.com/pola-rs/polars/blob/5d8ebabf11caea54a5c29178a64a058762f49766/py-polars/src/polars/_utils/various.py#L738-L757","documentation":"Raised from `_NamespaceSuggestMixin.__getattr__` when a namespace object is accessed with an attribute name it does not define. It is an enhanced AttributeError: difflib found a close public-attribute match, so the message includes a 'Did you mean' suggestion for the typo.","triggerScenarios":"Attribute access with a typo; a close match exists.","commonSituations":"See trigger scenarios.","solutions":["Use the suggested attribute name shown after 'Did you mean'."],"exampleFix":"getattr(obj, matches[0])","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5d8ebabf11caea54a5c29178a64a058762f49766","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}