[Python-Dev] PEP 557: Data Classes
ncoghlan at gmail.com
Wed Oct 11 22:56:56 EDT 2017
On 12 October 2017 at 06:33, Mike Miller <python-dev at mgmiller.net> wrote:
> (Apologies for reviving a dead horse, but may not be around at the blessed
> As potential names of this concept, I liked record and row, but agreed
> they were a bit too specific and not quite exact. In my recent (unrelated)
> reading however, I came across another term and think it might fit better,
> called an "entity."
> It has some nice properties:
> - Traditional dictionary definition, meaning "thing"
> - Same specificity as the current base-class name: object
> - Corresponds to a class or instance (depending on context) in data
>From my perspective, the main benefit of a compound name like "data class"
is that it emphasises a deliberate behavioural choice (adopted from attrs):
data classes are just regular classes, with some definition time logic to
help define data fields.
By contrast, if we give them their own name (as with suggestions like
record, row, entity), that makes them start to sound more like enums: an
alternative base class with different runtime behaviour from a regular
P.S. I'll grant that this reasoning doesn't entirely mesh with the naming
of "Abstract Base Class", but that phrase at least explicitly has the word
"base" in it, suggesting that inheritance is involved in the way it works.
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev