Message406461
We can remove the C stack use and general overhead of calling special methods implemented in Python for attribute access and indexing.
Each operation has a special method that implements it. When that special method is implemented in Python, we should avoid the `tp_xxx` slot machinery and use the same mechanism we use for normal calls to Python functions.
* BINARY_SUBSCR: `__getitem__`
* STORE_SUBSCR: `__setitem__`
* LOAD_ATTR: `__getattribute__` (and maybe `__getattr__`)
* STORE_ATTR: `__setattr__`
It probably isn't worth bothering with the deletion forms.
The getters (`__getitem__` and `__getattribute__`) are relatively simple, as the call returns the result.
The setters are a bit more complicated as the return value needs to be discarded, so an additional frame which discards the result of the call needs to be inserted. |
|
| Date |
User |
Action |
Args |
| 2021-11-17 09:50:11 | Mark.Shannon | set | recipients:
+ Mark.Shannon, pablogsal, brandtbucher |
| 2021-11-17 09:50:11 | Mark.Shannon | set | messageid: <1637142611.15.0.521267590311.issue45829@roundup.psfhosted.org> |
| 2021-11-17 09:50:11 | Mark.Shannon | link | issue45829 messages |
| 2021-11-17 09:50:10 | Mark.Shannon | create | |
|