Closed leoburgy closed 1 month ago
So the problem here is that SequenceFile
is generic over the sequence class (either TextSequence
or DigitalSequence
) dependening on the value of the digital
flag. Last time I checked it wasn't possible to overload the __init__
method of a class with different arguments, so even if you open a SequenceFile
in digital mode MyPy thinks that the read_block
returns a SequenceBlock[Sequence]
instead of a SequenceBlock[DigitalSequence]
and you get the warning.
I guess if you write:
sequences: DigitalSequenceBlock = seq_file.read_block()
it should be fine? I don't have a solution at the moment.
Thank you for explaining the cause :) I tried to type-hint the returned sequences object; however, in that case the method call get highlighted…
Hello,
I would like to know why I get a type warning in PyCharm in the conditions described below. In addition, the type hint possibilities are repeated three times in the warning. Nothing is preventing me from using the package but I would love to see no warning at all when false positive ;)
I get the warning
when I write the following code
My environment is the following:
Thanks in advance for any information and I am happy to help fix the problem ;)