<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 2, 2019 at 10:18 PM Paul Ganssle <<a href="mailto:paul@ganssle.io">paul@ganssle.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF">
<p>.. the
original objection was that this implementation assumes that the
datetime subclass has a constructor with the same (or a
sufficiently similar) signature as datetime.</p></div></blockquote><div>While this was used as a possible rationale for the way standard types behave, the main objection to changing datetime classes is that it will make them behave differently from builtins. For example:</div><div><div><br></div><div>>>> class F(float):</div><div>... pass</div><div>...</div></div><div><div>>>> type(F.fromhex('AA'))</div><div><class '__main__.F'></div><div>>>> type(F(1) + F(2))</div><div><class 'float'></div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><p> This may be a
legitimate gripe, but unfortunately that ship has sailed long ago.
All of datetime's alternate constructors make this assumption. Any
subclass that does not meet this requirement must have worked
around it long ago (or they don't care about alternate
constructors).</p></div></blockquote><div><br></div><div>This is right, but the same argument is equally applicable to int, float, etc. subclasses. If you want to limit your change to datetime types you should explain what makes these types special. </div></div></div></div></div>