In Python, obviously it's possible to assign to names, e.g. a = 1. It's also valid to assign to attributes (a.b = 1 - AFAIK this corresponds to the __setattr__ special method) and indexing operations (a[b] = 1, which corresponds to __setitem__).
In Lua, those are the only valid assignment targets - the language's grammar enforces that restriction: var ::= Name | prefixexp '[' exp ']' | prefixexp '.' Name.
Are those three forms also an exhaustive list of valid assignment targets in Python or are there others? (For example, according to this answer, it's not valid to assign to a function call: f() = 1 is invalid.)
Also, is the restriction to valid assignment targets enforced by the grammar as in Lua, or later in the source => bytecode compilation process?
single_target) and the unpacking construct mentioned by @blhsing (star_targets).var ::= Name | prefixexp '[' exp ']' | prefixexp '.' Namebriefly as I dont know luavaris either aName, an expression ending in square brackets, or an expression ending in.followed by aName. Comma-separated lists of thosevars are the only things that can appear to the left of=in Lua.