That’s fair. My point is that examples like this show when eliding a kwarg illuminates an important name. We should also consider whether the API could’ve used more context-appropriate names in the first place, and how PEP-736 would look with those names.
In this case, it seems like the function does have more context on meter and excluded_urls (and maybe more, depending upon what’s in the …), which could use a more context-appropriate name. This is a case where the poster’s missing context was only missed because it came from the global scope, and only stood out so much in PEP 736 because the add_instrument didn’t use a more context-appropriate name for meter and excluded_urls. Maybe this is the appropriate comparison?
app.add_middleware(
OpenTelemetryMiddleware,
excluded_urls=parsed_exclusions,
default_span_details=_get_default_span_details,
server_request_hook=,
client_request_hook=,
client_response_hook=,
tracer_provider=,
meter=instrument_meter,
)
…which still stands out. So the more I think about this example, the more I agree with it’s author. Wrappers and factories like instrument_app() will usually only have more context for some subset of the arguments they pass along, which are exactly the arguments that would stand out if the others are elided.
So to paraphrase the author, the PEP makes important differences become more visible so long as the important differences are given different names.