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

Requests for new public APIs #3176

Open
2 of 13 tasks
karpetrosyan opened this issue Apr 21, 2024 · 3 comments
Open
2 of 13 tasks

Requests for new public APIs #3176

karpetrosyan opened this issue Apr 21, 2024 · 3 comments

Comments

@karpetrosyan
Copy link
Member

karpetrosyan commented Apr 21, 2024

Ref: encode/starlette#2534 (comment)

This issue was opened to resolve all kinds of problems where third-party packages may need to use private imports. We should definitely expose them to avoid problems like #3130 (comment).

I will include the package name along with its private imports (only starlette for now), so we can clearly identify what needs to be exposed.

Note that:

  • -> Not yet publicly exposed
  • -> Publicly exposed

We can also add other packages as well to track all of them in this issue.

Starlette

@tomchristie
Copy link
Member

tomchristie commented Apr 21, 2024

Thanks @karpetrosyan ☺️

We should definitely expose them

So... I'm not necessarily(?) convinced that's the outcome I'd like to see here.
Mostly I think these types end up obscuring the actual API and are code smells that should be squished.

For example, switching to the following* seems clearer to me...

   url : httpx.URL | str,
   headers: httpx.Header | Mapping[str, str] | Sequence[Tuple[str, str]],
   params: httpx.QueryParams | Mapping[str, str] | Sequence[Tuple[str, str]],
   ...

* useful starting point for discussion

@T-256
Copy link
Contributor

T-256 commented Apr 24, 2024

I'm curios why not just expose _types module instead?

from httpx.types import HeaderTypes, QueryParamsTypes, URLTypes

...

   url : URLTypes | str,
   headers: HeaderTypes | Mapping[str, str] | Sequence[Tuple[str, str]],
   params: QueryParamsTypes | Mapping[str, str] | Sequence[Tuple[str, str]],
   ...

@tomchristie
Copy link
Member

I'm curios why not just expose _types module instead?

Mostly I think these types end up obscuring the actual API and are code smells that should be squished.

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

No branches or pull requests

3 participants