Skip to content

Docstrings, type annotations, code formatting with ruff#4

Open
ntamas wants to merge 1 commit into
jsiembida:masterfrom
ntamas:fix/docs-and-type-annotations
Open

Docstrings, type annotations, code formatting with ruff#4
ntamas wants to merge 1 commit into
jsiembida:masterfrom
ntamas:fix/docs-and-type-annotations

Conversation

@ntamas

@ntamas ntamas commented Jul 2, 2026

Copy link
Copy Markdown

This PR modernizes the codebase by the following:

  • added docstrings to public functions and classes
  • added full type annotations so that uv run ty check passes cleanly on ntp.py
  • formatted the code with ruff
  • dropped old pre-3.10 Python syntax as all earlier versions of Python are now EOL

I did this primarily for inclusion of the library in a larger project of mine where we need to follow stricter conventions (especially regarding type correctness), but I thought this might be useful for the upstream project as well.

No changes in behaviour were added yet.

Note that due to the usage of type annotations and the current minimum Python version of the project being at 3.5 this is a breaking change. setup.py should probably be migrated to pyproject.toml as well in the future; let me know if you would like me to file a PR for that.

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.

1 participant