Return type of add_p2p_connection and add_outbound_p2p_connection is not explicitly typed so LSPs treats the return as Any.
Add explicit return type to improve DX.
Return type of add_p2p_connection and add_outbound_p2p_connection is not explicitly typed so LSPs treats the return as Any.
Add explicit return type to improve DX.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
Concept ACK
764 | @@ -761,7 +765,7 @@ def assert_start_raises_init_error(self, extra_args=None, expected_msg=None, mat 765 | if assert_msg: 766 | self._raise_assertion_error(assert_msg) 767 | 768 | - def add_p2p_connection(self, p2p_conn, *, wait_for_verack=True, send_version=True, supports_v2_p2p=None, wait_for_v2_handshake=True, expect_success=True, **kwargs): 769 | + def add_p2p_connection(self, p2p_conn: P2PInterfaceT, *, wait_for_verack=True, send_version=True, supports_v2_p2p=None, wait_for_v2_handshake=True, expect_success=True, **kwargs) -> P2PInterfaceT:
def add_p2p_connection(self, p2p_conn: P2PInterfaceT, *, wait_for_verack=True, send_version=True, supports_v2_p2p=None, wait_for_v2_handshake=True, expect_success=True,
...
**kwargs,) -> P2PInterfaceT:
nit: at some point the lines are getting long enough to split them. Maybe now? (same below)
I agree. Done on b08c7da4d19cf259f86a7b91a473fb6014f19eb0
I don't use type annotations in Python code, but seems fine if others want them
Thanks for the review. Force-pushed b08c7da4d19cf259f86a7b91a473fb6014f19eb0 addressing #36547 (review)
ACK b08c7da4d19cf259f86a7b91a473fb6014f19eb0
In an editor that reads python types, a dot on the value returned by add_p2p_connection or add_outbound_p2p_connection lists the methods of the class that was passed in, including those methods from P2PInterface.