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,
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, owner, name):
self.name = name
def __get__(self, ins
Thank you to everyone who participated (Kirill, Raymond, Nick, Naoki). I've
decided there are too many caveats for this approach to be worthwhile and
I'm giving up on it.
Kind regards,
Tin
On Sat, Mar 24, 2018 at 3:18 PM Tin Tvrtković wrote:
> Hi Python-dev,
>
> I'm one of the core attrs contri