Skip to content

Commit 4a5e6c9

Browse files
add NEWS files: Enhance subscripting with attribute-based fallback
1 parent 41bc293 commit 4a5e6c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The subscript operator (``obj[key]``) now falls back to an attribute-based
2+
lookup of ``__getitem__`` when the type does not define a mapping or
3+
sequence slot. This lookup follows normal attribute resolution rules,
4+
including ``__getattribute__`` and ``__getattr__``. This allows classes
5+
that provide ``__getitem__`` purely as an attribute or through dynamic
6+
attribute handlers to support subscripting.

0 commit comments

Comments
 (0)