Skip to content

chore: add type annotation to Bio/File.py#5088

Open
szabgab wants to merge 1 commit intobiopython:masterfrom
szabgab:szabgab/type-annotations-file
Open

chore: add type annotation to Bio/File.py#5088
szabgab wants to merge 1 commit intobiopython:masterfrom
szabgab:szabgab/type-annotations-file

Conversation

@szabgab
Copy link

@szabgab szabgab commented Oct 24, 2025

  • I hereby agree to dual licence this and any previous contributions under both
    the Biopython License Agreement AND the BSD 3-Clause License.

  • I have read the CONTRIBUTING.rst file, have run pre-commit
    locally, and understand that continuous integration checks will be used to
    confirm the Biopython unit tests and style checks pass with these changes.

  • I have added my name to the alphabetical contributors listings in the files
    NEWS.rst and CONTRIB.rst as part of this pull request, am listed
    already, or do not wish to be listed. (This acknowledgement is optional.)

Addresses #2236 and does not touch files that are addressed in #5057

@peterjc
Copy link
Member

peterjc commented Oct 26, 2025

That's just a tiny fraction of the module - and a private bit of the API too - did you do more but forgot to push the work to GitHub?

@szabgab
Copy link
Author

szabgab commented Oct 26, 2025

I thought smaller PRs would make it easier to review and accept.

@peterjc
Copy link
Member

peterjc commented Oct 26, 2025

For type annotation, please do at least a whole file. Or most of it.

@szabgab szabgab force-pushed the szabgab/type-annotations-file branch from fd22de7 to e0ab915 Compare October 29, 2025 12:35
@szabgab szabgab requested a review from peterjc as a code owner October 29, 2025 12:35
@szabgab
Copy link
Author

szabgab commented Oct 29, 2025

OK. I have made some progress. This still needs more work.


from typing_extensions import TypeAlias
from typing import Callable
from _typeshed import FileDescriptorOrPath
Copy link
Member

Choose a reason for hiding this comment

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

That's not in the standard library - see ModuleNotFoundError: No module named '_typeshed' errors in the CI testing.

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