-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
File.as_handle_and_flag #4410
base: master
Are you sure you want to change the base?
File.as_handle_and_flag #4410
Conversation
I like the more consistent use of |
I am not a big fan of utility functions, as it is one more API to remember. In the past, we spent some effort removing such utility functions from Biopython because they were not consistently being used by developers, as they were not always aware of their existence. So I am hesitant to add more utility functions. |
On the other hand, the helper function avoids a lot of repetitive boiler plate code. So I like this change in general. I'm not sure we need the extra function Any accidental double iteration in |
I think the first step would be to fix the The challenge is that |
Opening a file with
|
- New function as_handle_and_flag - New function check_handle_mode - Use as_handle or as_handle_and_flag where appropriate
44ca0d2
to
57e8b9c
Compare
Follow-up on #4377 ("mypy pre-commit hook").
as_handle_and_flag
check_handle_mode
as_handle
oras_handle_and_flag
where appropriate_PathLikeTypes
,_IOSource
and_TextIOSource
toBio.File
moduleI 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 runpre-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
andCONTRIB.rst
as part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)