Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171026/c5155177/attachment.html below:
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 26 October 2017 at 07:30, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">+1 on a classmethod constructor<div>+0 on a based-on-type default constructor</div><div><br></div><div>+inf on SOMETHING!</div><div><br></div><div>Let's get passed the bike shedding and make this work!</div></div></blockquote><div><br></div>I'll also note that these aren't either/or outcomes: adding a str-specific classmethod *doesn't* preclude implicitly calling that class method from the default constructor later based on the input type.</div><div class="gmail_quote"><br></div><div class="gmail_quote">For example, decimal.Decimal.from_float() was added before the type constructor gained native support for float inputs, due to concerns about potential binary-vs-decimal rounding errors arising from doing such conversions implicitly.</div><div class="gmail_quote"></div><div class="gmail_quote"><br></div><div class="gmail_quote">So we can add "datetime.fromisoformat(isotime: str)" now, and then *if* we later decide to support the "type(x)(str(x)) == x" numeric invariant for the datetime classes, that can be specified as "If the constructor arguments consist of a single string, that is handled by calling the fromisoformat class method".<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Nick.<br></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Nick Coghlan  |  <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>  |  Brisbane, Australia</div>
</div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4