python-attrs / attrs

Python Classes Without Boilerplate
https://www.attrs.org/
MIT License
5.31k stars 374 forks source link

Preserve AttributeError in slotted classes with cached_property #1253

Closed dlax closed 7 months ago

dlax commented 8 months ago

Summary

In slotted classes' generated __getattr__(), we try __getattribute__() before __getattr__(), if available, and eventually let AttributeError propagate. This matches better with the behaviour described in Python's documentation Customizing attribute access.

Fix https://github.com/python-attrs/attrs/issues/1230

Pull Request Check List

hynek commented 8 months ago

ping @diabolo-dan :)

hynek commented 7 months ago

thanks everyone!