<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 12.05.2016 02:16, Alexander Belopolsky wrote:<br>
<blockquote
cite="mid:CAP7h-xZF-FxUjh9BW3mrA-ER=Rr7a2AJJMwwVJfX9GPEVA5+-g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, May 11, 2016 at 4:36 PM, Ian
Kelly <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:ian.g.kelly@gmail.com" target="_blank">ian.g.kelly@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":1rt" class="a3s aXjCH">Still best to be
explicit:<br>
<br>
>>> sleep(timedelta(100))<br>
<br>
It would be awesome if that actually worked.</div>
</blockquote>
</div>
<br>
FWIW, I would not mind seeing sleep() as a timedelta instance
method:<br>
<br>
>>> timedelta(seconds=42).sleep()</div>
</div>
</blockquote>
<br>
Some would suggest that introducing a new protocol like<br>
<br>
- timedelta(seconds=42).__seconds__<br>
<br>
defining an ABC<br>
<br>
- class SecondLike(abc.ABC):<br>
- @abc.abstractmethod<br>
- def __seconds__(self):<br>
- raise NotImplementedError<br>
<br>
defining an extraction function<br>
<br>
- def os.seconds...<br>
<br>
and let all stdlib functions which accepts integer/float seconds
also accept SecondLike objects as the solution to the problem.<br>
<br>
<br>
I have to admit that I like your idea more.<br>
<br>
<br>
Sven<br>
</body>
</html>