Sometimes it may be necessary (yes, likely against best practices) to deal with nested objects, such as lists, which can require multi-level indexation. I am curious of the following:
1. In Python, is there a way to refer to the variable being assigned to on the right side of the assignment operator? I am thinking some special keyword as in the following contrived example:
object1[0][1][2][3][index_4][new_index_5][another_index_6][one_more_index_7][8][finally_index_9] = len(itself)//4+max(itself)
where I am using itself
to refer to the mess on the left side of this assignment. I am especially trying to avoid temporary variables.
2.a I assume, a special term must exist for this technique. If it does, what's it called?
2.b Is the above functionality available in other programming languages? Also, have there been any PEPs (Python Enhancement Proposals) that included discussion of the above, rejected or otherwise?
[According to my internet search, variable self-referring to the right of the assignment operator is not possible, in Python at least, but I could be wrong.]