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

Type hints on IHostnameResolver.resolveHostName seem incorrect #10276

Closed
twisted-trac opened this issue Nov 16, 2021 · 0 comments · Fixed by #11589
Closed

Type hints on IHostnameResolver.resolveHostName seem incorrect #10276

twisted-trac opened this issue Nov 16, 2021 · 0 comments · Fixed by #11589

Comments

@twisted-trac
Copy link

clokep's avatar @clokep reported
Trac ID trac#10276
Type defect
Created 2021-11-16 13:02:18Z

I believe the type hints on IHostnameResolver.resolveHostName are incorrect in two places:

  1. addressTypes needs to be an iterable of IAddress types, not instances. (I don't think it needs to be a sequence, but not 100% sure on that.)
  2. The return type might be incorrect. It is declared as IResolutionReceiver (one of the input arguments), but at least the GAIResolver implementation returns an instance of IHostResolution. So something funky is going on.

Found while adding type hints to Synapse: matrix-org/synapse#11328

Searchable metadata
trac-id__10276 10276
type__defect defect
reporter__clokep clokep
priority__low low
milestone__None None
branch__ 
branch_author__ 
status__new new
resolution__None None
component__core core
keywords__None None
time__1637067738920446 1637067738920446
changetime__1637067738920446 1637067738920446
version__None None
owner__None None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant