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 Ricyteach
Recipients Ricyteach, eric.smith
Date 2018-03-26.02:25:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1522031149.18.0.467229070634.issue33141@psf.upfronthosting.co.za>
In-reply-to
Content
Summary: The descriptor `__set_name__` functionality (introduced in Python 3.6) does not seem to be working correctly for `dataclass.Field` objects with a default pointing to a descriptor. I have attached a file demonstrating the trouble.

Details: If I set a `dataclass` class object field to a `dataclass.field` with a descriptor object for the `default` argument, the descriptor's `__set_name__` method is not called during initialization. This is unexpected because descriptors themselves seem to work pretty much flawlessly, otherwise. 

(Bravo on that by the way! Working descriptors isn't mentioned at all in the PEP as a feature but I was very pleased to see them working!!)

System details:
Python 3.7b02
Windows 10
PyCharm Community Edition

btw this is my first ever Python bug report; I hope I did a good job.
History
Date User Action Args
2018-03-26 02:25:49Ricyteachsetrecipients: + Ricyteach, eric.smith
2018-03-26 02:25:49Ricyteachsetmessageid: <1522031149.18.0.467229070634.issue33141@psf.upfronthosting.co.za>
2018-03-26 02:25:48Ricyteachlinkissue33141 messages
2018-03-26 02:25:47Ricyteachcreate