Issue 1657573: Add syntax for dynamic attribute access (original) (raw)
Add syntax to allow easier access to attributes when attribute name known only at run-time. E.g., replace
setattr(obj, attr_name, getattr(obj, attr_name) + 1)
with
obj.(attr_name) += 1
For further discussion, see PEP 363 [PROVISIONAL NUMBER]