Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Self TypeVar for SSHConnection __aenter__ #600

Merged
merged 2 commits into from
Nov 12, 2023

Conversation

PJB3005
Copy link
Contributor

@PJB3005 PJB3005 commented Oct 17, 2023

This makes it so that when using a subclass as a context manager like so:

async with await asyncssh.connect(...) as con:

the con variable has the type SSHClientConnection instead of simply SSHConnection.

This is equivalent to the typing.Self type introduced in Python 3.11, but backwards compatible.

This makes it so that when using a subclass as a context manager like so:

async with asyncssh.connect(...) as con:

the con variable has the type SSHClientConnection instead of simply SSHConnection.
@codecov-commenter
Copy link

codecov-commenter commented Oct 17, 2023

Codecov Report

Merging #600 (ea46520) into develop (5ca8487) will increase coverage by 0.00%.
Report is 7 commits behind head on develop.
The diff coverage is 100.00%.

❗ Current head ea46520 differs from pull request most recent head cad4aa8. Consider uploading reports for the commit cad4aa8 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff            @@
##           develop     #600   +/-   ##
========================================
  Coverage    99.84%   99.84%           
========================================
  Files           93       93           
  Lines        26808    26809    +1     
  Branches      2797     2797           
========================================
+ Hits         26767    26768    +1     
  Misses          38       38           
  Partials         3        3           
Files Coverage Δ
asyncssh/connection.py 100.00% <100.00%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

asyncssh/connection.py Outdated Show resolved Hide resolved
@ronf ronf merged commit e9e95ae into ronf:develop Nov 12, 2023
@ronf
Copy link
Owner

ronf commented Nov 12, 2023

Thanks very much!

@PJB3005 PJB3005 deleted the 23-10-17-connection_aenter_self branch November 19, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants