[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: Okay. I'm sure Ned is relieved! -- priority: release blocker -> resolution: -> wont fix stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Guido van Rossum
Guido van Rossum added the comment: I find it a satisfying outcome that we decided *not* to remove this in the last week before rc1. While it's true that dataclasses are a new feature in 3.7.0, considerable effort went into stabilizing the betas. Let's close this issue.

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 16, 2018, at 16:48, Eric V. Smith wrote: > Do you really want to add a __init__ to each of the 500 classes? Well, of course *I* do, but I’m weird like that. > That is, the base class could legitimately being

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: The concern is that you've created an awesome base class, and you've written 500 dataclasses that are derived from it, but you want to use the base class's __init__ for all 500. Do you really want to add a __init__ to each of the 500

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 16, 2018, at 16:09, Eric V. Smith wrote: > > I think the concern is: > > from dataclasses import * > > class B: >def __init__(self, a, b, c): ># do something with a, b, c, and maybe use

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: I think the concern is: from dataclasses import * class B: def __init__(self, a, b, c): # do something with a, b, c, and maybe use fields(self) to figure out we have a "i" field self.i = a + b + c

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Really? Why doesn't this work in the derived dataclass? def __init__(self, *args, **kws): super().__init__(*args, **kws) -- ___ Python tracker

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: Larry points out that one potential use case is a base class that defines some awesome __init__ that you want to use. Without init=False, there’s no good way to use it. -- ___ Python tracker

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- priority: normal -> release blocker ___ Python tracker ___

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Ned Deily
Ned Deily added the comment: If we agree that we don't need it, the time to do it is now, before 3.7.0 releases. -- ___ Python tracker

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: +ned.deily for the 3.7 exemption. -- nosy: +ned.deily ___ Python tracker ___

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On May 16, 2018, at 12:02, Eric V. Smith wrote: > > It's a little late in the 3.7 release cycle to remove it, so maybe we can > decide to deprecate it in 3.8? Although if there's clearly no reason for it > to

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Eric V. Smith
Eric V. Smith added the comment: The behavior used to be that we'd raise an error if you tried to overwrite a dunder method. Then we decided that the existence of a dunder method meant you didn't want it overwritten, so now we don't need to explicitly set a flag to False

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Make that `return super().__init__()` of course. I can haz (editable) GitHub issues! -- ___ Python tracker

[issue33539] Remove `init` flag from @dataclass?

2018-05-16 Thread Barry A. Warsaw
New submission from Barry A. Warsaw : In reading over the new dataclasses documentation, I'm unsure what the `init` flag is used for, given that: * If you already have a __init__(), then dataclasses won't add one * If you don't have a __init__(), why wouldn't you want