On 11 September 2017 at 12:27, Raymond Hettinger <raymond.hettin...@gmail.com> wrote: > Once you get agreement on the functionality, name bike-shedding will likely > be next. In a way, all classes are data classes so that name doesn't tell me > much. Instead, it would be nice to have something suggestive of what it > actually does which is automatically adding boilerplate methods to a general > purpose class. Perhaps, @boilerplate or @autoinit or some such.
"data class" is essentially short for "declarative data class" or "data-centric class": as a class author the decorator allows you to focus on declaring the data fields, and *not* on procedurally defining how those fields are initialised (and compared, and displayed, and hashed, ...) the way you do with a traditional imperative class definition. When I changed the name of contextlib.ignored to the more cryptic contextlib.suppress, I made the mistake of letting the folks that knew how the context manager worked dictate the name, rather than allowing it to keep the name that described what it was for. I think the same will apply here: we'll get a better name if we focus on describing the problem the capability solves in the simplest possible terms than we will if we choose something that more accurately describes how it is implemented. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com