Skip to content

Type hints on IHostnameResolver.resolveHostName seem incorrect #10276

@twisted-trac

Description

@twisted-trac
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions