This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, eric.smith, gvanrossum
Date 2018-05-16.14:53:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1526482393.81.0.682650639539.issue33539@psf.upfronthosting.co.za>
In-reply-to
Content
In reading over the new dataclasses documentation, I'm unsure what the `init` flag is used for, given that:

* If you already have a __init__(), then dataclasses won't add one
* If you don't have a __init__(), why wouldn't you want dataclasses to add one?  Without that, how do your attributes get initialized?

If there is a valid use case for `init`, I'm happy to add it to the documentation.  If there isn't, can we call YAGNI and remove the flag?

I'm mildly of the same opinion with `repr` but I can see some value in wanting to defer to object.__repr__().  OTOH, it should be pretty easy to just write:

@dataclass
class Foo:
    def __repr__(self):
        return super.__repr__()
History
Date User Action Args
2018-05-16 14:53:13barrysetrecipients: + barry, gvanrossum, eric.smith
2018-05-16 14:53:13barrysetmessageid: <1526482393.81.0.682650639539.issue33539@psf.upfronthosting.co.za>
2018-05-16 14:53:13barrylinkissue33539 messages
2018-05-16 14:53:13barrycreate