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

Typing highlevel open tcp stream #2725

Merged

Conversation

CoolCat467
Copy link
Member

This PR adds type annotations to _highlevel_open_tcp_stream.py

I would love feedback and any comments on how this could be improved to be more accurate.

@codecov
Copy link

codecov bot commented Jul 29, 2023

Codecov Report

Merging #2725 (e1b4b3f) into master (08625dc) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2725   +/-   ##
=======================================
  Coverage   98.90%   98.90%           
=======================================
  Files         113      113           
  Lines       16665    16669    +4     
  Branches     3021     3021           
=======================================
+ Hits        16483    16487    +4     
  Misses        125      125           
  Partials       57       57           
Files Changed Coverage Δ
trio/socket.py 100.00% <ø> (ø)
trio/_highlevel_open_tcp_stream.py 97.64% <100.00%> (+0.11%) ⬆️

@A5rocks A5rocks added the typing Adding static types to trio's interface label Jul 30, 2023
@TeamSpen210
Copy link
Contributor

This branch includes the commits for #2724 for some reason?

@CoolCat467
Copy link
Member Author

Rats I must have not changed branch before committing

@CoolCat467 CoolCat467 closed this Jul 30, 2023
@CoolCat467 CoolCat467 force-pushed the typing-highlevel-open-tcp-stream branch from 423c9fe to cf1f3c7 Compare July 30, 2023 01:09
@CoolCat467 CoolCat467 reopened this Jul 30, 2023
Copy link
Member

@jakkdl jakkdl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update pyproject.toml to add this file to the list of files that has increased strictness.

trio/_highlevel_open_tcp_stream.py Show resolved Hide resolved
trio/_highlevel_open_tcp_stream.py Outdated Show resolved Hide resolved
trio/_highlevel_open_tcp_stream.py Show resolved Hide resolved
@CoolCat467 CoolCat467 requested a review from jakkdl July 31, 2023 00:12
Copy link
Contributor

@A5rocks A5rocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Let's wait on @jakkdl though!

@jakkdl
Copy link
Member

jakkdl commented Jul 31, 2023

Played around with it locally to figure out what was going on with Address, and realised that the call to nursery.start_soon being ~untyped masked what would become a pretty nasty type error if/when it gets typed.

jakkdl added 2 commits July 31, 2023 15:11
This reverts commit cf546ed.
@jakkdl
Copy link
Member

jakkdl commented Jul 31, 2023

(sorry for the extraneous commits, a13c3cd wasn't showing up for some reason)

@A5rocks A5rocks merged commit ccf4e24 into python-trio:master Aug 1, 2023
@trio-bot
Copy link

trio-bot bot commented Aug 1, 2023

Hey @CoolCat467, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂

If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:

  • Github will automatically subscribe you to notifications on all our repositories. (But you can unsubscribe again if you don't want the spam.)

  • You'll be able to help us manage issues (add labels, close them, etc.)

  • You'll be able to review and merge other people's pull requests

  • You'll get a [member] badge next to your name when participating in the Trio repos, and you'll have the option of adding your name to our member's page and putting our icon on your Github profile (details)

If you want to read more, here's the relevant section in our contributing guide.

Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you.

If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out!

@A5rocks
Copy link
Contributor

A5rocks commented Aug 1, 2023

Joining the organization means #2727 is unnecessary and you can contribute to the base PR!

@CoolCat467 CoolCat467 deleted the typing-highlevel-open-tcp-stream branch August 2, 2023 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing Adding static types to trio's interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants