ericvsmith / dataclasses

Apache License 2.0
587 stars 53 forks source link

astuple transform nested by default is uncommon use case #118

Closed guyskk closed 6 years ago

guyskk commented 6 years ago
@dataclass
class Point:
     x: int
     y: int

@dataclass
class Line:
    start: Point
    end: Point

line = Line(Point(10, 20), Point(20, 20))
p1, p2 = astuple(line)

I expect p1 and p2 is Point object. And I can't see any reason to convert them to tuple. In addition, it can't build back a line by Line(p1, p2) because p1, p2 is not Point object.

ericvsmith commented 6 years ago

This repo is now only for the backport of dataclasses to Python 3.6. Please raise this issue on the python-dev mailing list.

hynek commented 6 years ago

You should ask Mariatta to write you an auto-close bot. 😳

ericvsmith commented 6 years ago

:wink:

I've considered archiving this repo, and creating a new one just for the 3.6 backport. We'll see if my new README language discourages using this repo for discussions that belong on python-dev.