Skip to content

Commit

Permalink
Fix type annotations for Python 3.8 to 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
althonos committed Oct 8, 2024
1 parent 2160045 commit c2fb99e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pyhmmer/hmmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import os
import operator
import queue
import sys
import threading
import time
import typing
Expand Down Expand Up @@ -80,10 +81,16 @@

# `typing.Literal`` is only available in Python 3.8 and later
if typing.TYPE_CHECKING:
try:
from typing import Literal, TypedDict, Unpack
except ImportError:
from typing_extensions import Literal, TypedDict, Unpack # type: ignore

if sys.version_info >= (3, 8):
from typing import Literal, TypedDict
else:
from typing_extensions import Literal, TypedDict # type: ignore

if sys.version_info >= (3, 11):
from typing import Unpack
else:
from typing_extensions import Unpack

from .plan7 import BIT_CUTOFFS, STRAND

Expand Down Expand Up @@ -116,9 +123,6 @@ class LongTargetsPipelineOptions(PipelineOptions, total=False):
block_length: int
window_length: typing.Optional[int]
window_beta: typing.Optional[float]





# --- Result class -----------------------------------------------------------
Expand Down

0 comments on commit c2fb99e

Please sign in to comment.