Skip to content

Conversation

@johnslavik
Copy link

A few improvements to package typing.

I removed the runtime dependency on the typing_extensions package.

See also python-poetry/poetry#9251 where I promoted that practice.

@johnslavik
Copy link
Author

I wanted to move type aliases to the if TYPE_CHECKING branch, but that would pose some problems to those who don't use PEP 563.

@johnslavik
Copy link
Author

johnslavik commented Apr 12, 2024

@willmcgugan Let me know if you are interested in moving @overloads to if TYPE_CHECKING branches like here: https://github.com/jaraco/path/pull/224/files.

@willmcgugan
Copy link
Owner

Thanks.

What is the benefit of moving overloads inside a if TYPE_CHECKING block? Faster import?

@willmcgugan willmcgugan merged commit f9fa649 into willmcgugan:main Apr 19, 2024
@johnslavik
Copy link
Author

johnslavik commented Apr 19, 2024

Thanks.

What is the benefit of moving overloads inside a if TYPE_CHECKING block? Faster import?

I'd say less runtime overhead and less namespace mess (you don't have runtime access of typing-only overload and you don't create a few functions that are to be inexistent just a few moments later). For such a small library like this, it might not be necessary, but just showing that it's feasible.

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

Successfully merging this pull request may close these issues.

2 participants