On Fri, Apr 28, 2017 at 3:07 PM Nick Coghlan email@example.com wrote:
Yes, the point I attempted to raise earlier: at the language design level, "How do we make __init__ methods easier to write?" is the *wrong question* to be asking. It's treating the symptom (writing an imperative initialiser is repetitive when it comes to field names) rather than the root cause (writing imperative initialisers is still part of the baseline recommendation for writing classes, and we don't offer any supporting infrastructure for avoiding that directly in the standard library) [...]
Very well put. I also can't help but hope these efforts lead to Python also acquiring better tools for dealing with structured data (instances of classes and enumerations) down the road. Like a Pythonic version of Rust's match, for example. That would be really something.