Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
Closed
Description
Bug report
object.__getattribute__ does not setname andobj ofAttributeError:
classTest:passtest=Test()try:print("test.a")test.aexceptAttributeErrorase:print(f"{e=}")print(f"{e.name=}")print(f"{e.obj=}")print()try:print('object.__getattribute__(test, "a")')object.__getattribute__(test,"a")exceptAttributeErrorase:print(f"{e=}")print(f"{e.name=}")print(f"{e.obj=}")
Output:
test.ae=AttributeError("'Test' object has no attribute 'a'")e.name='a'e.obj=<__main__.Test object at 0x7f2fc87a8760>object.__getattribute__(test, "a")e=AttributeError("'Test' object has no attribute 'a'")e.name=Nonee.obj=None- CPython versions tested on: Python 3.10.5, Python 3.12.0a0