On 27 March 2018 at 01:17, Eric V. Smith wrote:
> On 3/26/18 11:10 AM, Eric V. Smith wrote:
>>
>> On 3/26/18 11:08 AM, Nick Coghlan wrote:
>>>
>>> On 27 March 2018 at 00:40, Eric V. Smith wrote:
>
>
>>> Would it be feasible to define `Field.__set_name__`, and have that
>>> call `default.__set_nam
On 3/26/18 11:10 AM, Eric V. Smith wrote:
On 3/26/18 11:08 AM, Nick Coghlan wrote:
On 27 March 2018 at 00:40, Eric V. Smith wrote:
Would it be feasible to define `Field.__set_name__`, and have that
call `default.__set_name__` when the latter exists, and be a no-op
otherwise?
A clever idea!
On 3/26/18 11:08 AM, Nick Coghlan wrote:
On 27 March 2018 at 00:40, Eric V. Smith wrote:
https://bugs.python.org/issue33141 points out an interesting issue with
dataclasses and descriptors.
Given this code:
from dataclasses import *
class D:
"""A descriptor class that knows its name."""
On 27 March 2018 at 00:40, Eric V. Smith wrote:
> https://bugs.python.org/issue33141 points out an interesting issue with
> dataclasses and descriptors.
>
> Given this code:
>
> from dataclasses import *
>
> class D:
> """A descriptor class that knows its name."""
> def __set_name__(self,