...using a Haplotypes.write_line() method sorta like this
with open('file.hap') as file:
haps = Haplotypes(file)
for hap in haplotypes:
haps.write_line(hap)
The main challenge to this is that the Haplotypes class would need to accept a TextIO object instead of a Path or str representing a file. I haven't figured out a good way of doing this yet. One idea is to just use the existing fname param of Haplotypes.__init__() but then we would probably need to do something to check the type of the class and raise error messages if they try to read from it or use it with TabixFile? I'm not sure yet...