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

[RFC] make the public API stricter #143

Open
jameslamb opened this issue Aug 14, 2024 · 1 comment
Open

[RFC] make the public API stricter #143

jameslamb opened this issue Aug 14, 2024 · 1 comment
Assignees
Labels
feature request New feature or request

Comments

@jameslamb
Copy link
Member

Description

Since this library is still in development and breaking changes are not too disruptive, I think it's worth making the public API stricter right now.

Through some mix of the following:

  • requiring keyword-only arguments wherever possible
  • using __all__ entries in modules to limit what is exported (affects * imports and things like sphinx autodoc)
  • prefixing private functions, classes, methods, constants, etc. with _

Benefits of this work

Clarifies the boundary between the private and public API for users of the library.

Expands the set of implementation details that could be changed in the future without worrying about breaking users.

Reduces the risk of naming conflicts wherever * imports are used.

Acceptance Criteria

  • every non-testing module in the Python package has an __all__ list containing only its public attributes
  • keyword-only arguments are required wherever possible
  • every object that is not intended to be public is prefixed with a _

Approach

See these related issues for reference:

Make changes in this project to implement these things.

Notes

N/A

@jameslamb jameslamb added the feature request New feature or request label Aug 14, 2024
@RAMitchell
Copy link
Contributor

I missed this somehow, but this definitely a great idea.

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

No branches or pull requests

2 participants