Closed macserv closed 1 week ago
Can you discuss the inclusion of overloads? I'm not seeing the value they're bringing to the two interfaces you've implemented them with.
Sure! It allows the type checker to infer what will be returned by the method, based on whether or not pagination is being used. This doesn't do much within the API itself, but it improves the ergonomics of code that consumes the SDK.
Sure! It allows the type checker to infer what will be returned by the method, based on whether or not pagination is being used. This doesn't do much within the API itself, but it improves the ergonomics of code that consumes the SDK.
Not two minutes after I sent that did it click that it made the return type deterministic.
...I am not against this. I'd want to get it added to the remaining Pro API methods though and included in the dev docs as a part of the style guide.
This is an overall very solid PR with good enhancements. 🎉
I'd want to get [overloads] added to the remaining Pro API methods…
Overloads added to other Pro API methods.
I'd want to get [overloads] … included in the dev docs as a part of the style guide.
Updated contributors/index.rst
to specify that @overload
interfaces should be provided for methods with dynamic return types. Also added recommendation to use Optional[]
for types where value can be None
.
Pro
Package
APIPackage
model.ProApi.get_packages_v1()
with overloads.Typing Enhancements
files
parameter topro_api_request()
(create policies with icons!)get_computer_inventory_v1()
.