
April 28, 2022
4:14 p.m.
On 4/23/22 12:11, Christopher Barker wrote:
NOTE: another key question for this proposal is how you would handle mutable defaults -- anything special, or "don't do that"?
Why should they be handled at all? If the programmer writes def __init__(a, @b, @c=[]): pass then all instances that didn't have `c` given will share the same list -- just like if the code was: def __init__(a, b, c=[]): self.b = b self.c = c The purpose of the syntax is to automatically save arguments to same-named attributes, not to perform any other magic. -- ~Ethan~