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

Remove infinity support for tcp listener backlogs #2842

Merged
merged 9 commits into from
Oct 31, 2023

Conversation

CoolCat467
Copy link
Member

This PR makes due on my comment in 6f9ab95, removing support for math.inf as an argument for the tcp listener backlog, leaving only int | None as valid options.

@CoolCat467 CoolCat467 added the typing Adding static types to trio's interface label Oct 28, 2023
@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Merging #2842 (39380e8) into master (d7c5c64) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2842   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files         115      115           
  Lines       17585    17594    +9     
  Branches     3140     3142    +2     
=======================================
+ Hits        17442    17451    +9     
  Misses         99       99           
  Partials       44       44           
Files Coverage Δ
trio/_highlevel_open_tcp_listeners.py 100.00% <100.00%> (ø)
trio/_highlevel_ssl_helpers.py 100.00% <ø> (ø)
trio/_tests/test_highlevel_open_tcp_listeners.py 98.51% <100.00%> (+0.05%) ⬆️

@A5rocks
Copy link
Contributor

A5rocks commented Oct 28, 2023

While I get using int | None to work around flaws in the type system, I think there should at least be a deprecation period.

OH I should read the docs first. Oops. Deprecation not needed. Ignore me.

@njsmith
Copy link
Member

njsmith commented Oct 28, 2023

Let's just keep accepting inf even if it's not documented or listed as a valid type, as a little backcompat thing? no reason to break existing code and it's not really any extra maintenance burden.

@CoolCat467
Copy link
Member Author

Let's just keep accepting inf even if it's not documented or listed as a valid type, as a little backcompat thing? no reason to break existing code and it's not really any extra maintenance burden.

Added warning for inf but still accepts it as of daada74

@jakkdl
Copy link
Member

jakkdl commented Oct 30, 2023

I'd kinda like making this consistent across the whole codebase with corresponding DeprecationWarnings*, but this seems like a good thing on it's own.

* probably making it a very long deprecation period, since this mostly just is about the typing limitation (though I also do think it's much easier to specify None than having to import math.inf). Or not even raising a warning and just continue to accept math.inf without issue indefinitely, but add support for None (where that's not already the case) and specify the signature as only int|None.

trio/_highlevel_open_tcp_listeners.py Outdated Show resolved Hide resolved
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.

nit: feel free to merge regardless.

newsfragments/2842.removal.rst Outdated Show resolved Hide resolved
Co-authored-by: EXPLOSION <git@helvetica.moe>
@CoolCat467 CoolCat467 enabled auto-merge (squash) October 31, 2023 03:01
@CoolCat467 CoolCat467 merged commit bda5c11 into python-trio:master Oct 31, 2023
29 checks passed
@CoolCat467 CoolCat467 deleted the no-more-infinity branch October 31, 2023 03:09
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