Skip to content

Remove 'URIReference' from public interfaces - #170

Merged
sethmlarson merged 2 commits into
masterfrom
stricter-url-init-interface
Jul 30, 2019
Merged

Remove 'URIReference' from public interfaces#170
sethmlarson merged 2 commits into
masterfrom
stricter-url-init-interface

Conversation

@lovelydinosaur

@lovelydinosaur lovelydinosaur commented Jul 29, 2019

Copy link
Copy Markdown
Member

Drops rfc3986.uri.URIReference from being referenced in any public interface.
In fact it wasn't actually included in URLTypes in the first place.

Our copy_with and join will be less efficient - but if we want to resolve that we should do it in a different way, rather than exposing implementation-level types in our public interface.

@lovelydinosaur

lovelydinosaur commented Jul 29, 2019

Copy link
Copy Markdown
Member Author

We might also want to rethink the components attribute here - that's leaking implementation details at the moment.

A tighter API here would be for components to instead be _uri_reference.

We could also still expose a components interface, but as a plain named-tuple. (Or even a plain tuple, since we've got the by-name access anyway, and keeping a lower Type-surface would be good.)

@lovelydinosaur

Copy link
Copy Markdown
Member Author

Right, I've also dropped the url.components interface here. We don't need it as a public interface, since we've got by-name access anyways. If we did want to expose a tuple-like interface too, than let's do that as a plain tuple, rather than exposing rfc3986 as part of our interface.

Let's keep a really tight API surface area wherever possible.

@sethmlarson sethmlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this is what I was thinking for this as well.

@sethmlarson
sethmlarson merged commit db6731a into master Jul 30, 2019
@sethmlarson
sethmlarson deleted the stricter-url-init-interface branch July 30, 2019 00:46
Kludex referenced this pull request in pydantic/httpx2 May 11, 2026
* Made AsyncBackend::time async

* Made AsyncSemaphore::release async

* Made AsyncLock::release async
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants