close for Fasta object
There isn't a way to close a pyfastx.Fasta object, while would be consistent with python open, Have Fasta object as a context manager as well would be great.
P.S. wow, this is an awesomely usefully package
You don't have to manually close pyfastx.Fasta. It will be closed automatically.
Lianming Du @.***> writes:
You don't have to manually close pyfastx.Fasta. It will be closed automatically.
Automatically when it is garbage collected?? Yes, this happens with python files as well.
However, files have a close() under the 'explicit is better than implicit' and the fact that Python doesn't guarantee that there is reference counting or when an object will he garbage collected. Plus it is consistent with many clases that open resources, making Fasta object not a special case.
Have the Fasta object as a context manager would be a nice addition.
BTW, this is an AMAZING package. It is so annoying to split fastx files for cluster jobs. Not having convert gziped files or splice them is such a win. thank you!