-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
synmark/__main__.py
Outdated
|
||
d.addBoth(on_done) | ||
reactor.callWhenRunning(lambda: d.callback(True)) | ||
reactor.run() | ||
|
||
return d.result | ||
return cast(float, d.result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised a cast is needed here. Any idea why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
synmark/__main__.py:61: error: Incompatible return value type (got "object", expected "float") [return-value]
I think the Deferred
isn't being properly marked as returning a float
? (Maybe the Twisted trunk fixes this?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't quite figure this out, I think twisted trunk would fix it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from #16421 (comment) though this seems sane!
print(file_out.getvalue()) | ||
reactor.stop() | ||
return _ | ||
return res | ||
|
||
d.addBoth(on_done) | ||
reactor.callWhenRunning(lambda: d.callback(True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised mypy doesn't complain about feeding a bool into a Deferred[float]!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy, provided you've tested that synmark still actually runs!
I have! The logging suite seems broken unrelated to this PR so I Don't want to hold this up. |
Was trying to figure out synmark the other day and type hints were helpful.