<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 December 2017 at 20:38, Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><span class="gmail-"><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On 19 Dec. 2017 7:00 am, "Chris Barker" <<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>> wrote:<br type="attribution"><blockquote class="gmail-m_-8201760065580092382quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Are there other options??</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">plain old:</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><font face="monospace, monospace">@dataclass</font></div><div style="font-size:12.8px"><font face="monospace, monospace">class C:</font></div><div style="font-size:12.8px"><font face="monospace, monospace">Â Â a = 1</font></div><div style="font-size:12.8px"><font face="monospace, monospace">Â Â b = 1.0</font></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">would work, though then there would be no way to express fields without defaults:</div></div></blockquote></div></div><div dir="auto"><br></div></span><div dir="auto">The PEP already supports using "a = field(); b = field()" (etc) to declare untyped fields without a default value.</div><div dir="auto"><br></div></div></blockquote><div><br></div><div>The PEP is not 100% clear not this, but it is currently not the case and this may be intentional (one obvious way to do it)<tt>,</tt><br></div><div>I just tried and this does not work:<br></div><div><br></div><div>@dataclass</div><div>class C:</div><div>Â Â Â x = field()</div><div><br></div><div>generates `__init__` etc. with no arguments. I think however that it is better to generate an error than silently ignore it.</div><div>(Or if this a bug in the implementation, it should be just fixed.)<br></div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></div></div></div>