We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41bc293 commit 4a5e6c9Copy full SHA for 4a5e6c9
1 file changed
Misc/NEWS.d/next/Core_and_Builtins/subscript-attr-fallback.rst
@@ -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