This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith, pablogsal
Date 2021-07-16.19:21:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626463316.41.0.592910963075.issue44655@roundup.psfhosted.org>
In-reply-to
Content
Also, the dot after the first 'b' was confusing to me: I thought it had something to do with an attribute of b. And the quotes around the second 'b' were also confusing, but that's mostly because the original example initialized a class variable named 'b' with the str value 'b'.

Maybe a better error would use a colon:

AttributeError: foo: Did you mean: 'foo1'?

Looking at 3.10s behavior, I can't decide what logic it's using to suggest something:

>>> 'foo'.formatx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'formatx'. Did you mean: 'format'?
>>> class C: pass
...
>>> C().a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'C' object has no attribute 'a'
History
Date User Action Args
2021-07-16 19:21:56eric.smithsetrecipients: + eric.smith, pablogsal
2021-07-16 19:21:56eric.smithsetmessageid: <1626463316.41.0.592910963075.issue44655@roundup.psfhosted.org>
2021-07-16 19:21:56eric.smithlinkissue44655 messages
2021-07-16 19:21:56eric.smithcreate