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 levkivskyi
Recipients eric.smith, gvanrossum, levkivskyi
Date 2017-12-28.00:19:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514420371.28.0.213398074469.issue32428@psf.upfronthosting.co.za>
In-reply-to
Content
> I'm not sure I understand the distinction.

Initially I thought about only flagging code like this:

@dataclass
class C:
    x = field()

But not this:

@dataclass
class C:
    x = 42

Now I think we should probably flag both as errors.

> How do we only pick out `y` and probably `prop`, and ignore the rest, without being overly fragile to new things being added? I guess ignoring dunders and things in `__annotations__`. Is that close enough?

We had a similar problem while developing Protocol class (PEP 544). Currently we just a have a whitelist of names that are skipped:

'__abstractmethods__', '__annotations__', '__weakref__', '__dict__',
'__slots__', '__doc__', '__module__'

(plus some internal typing API names)
History
Date User Action Args
2017-12-28 00:19:31levkivskyisetrecipients: + levkivskyi, gvanrossum, eric.smith
2017-12-28 00:19:31levkivskyisetmessageid: <1514420371.28.0.213398074469.issue32428@psf.upfronthosting.co.za>
2017-12-28 00:19:31levkivskyilinkissue32428 messages
2017-12-28 00:19:31levkivskyicreate