Skip to content

Commit

Permalink
update type hints for class itself
Browse files Browse the repository at this point in the history
When using `from __future__ import annotations`, the class name can be directly used as type hint; Otherwise, use string like "ClassName" as type hint.
  • Loading branch information
CunliangGeng committed Oct 31, 2023
1 parent e53ba6e commit 62291dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nplinker/strain_collection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import json
from os import PathLike
from typing import Iterator
Expand Down Expand Up @@ -37,7 +38,7 @@ def __eq__(self, other) -> bool:
and self._strain_dict_name == other._strain_dict_name)
return NotImplemented

def __add__(self, other) -> 'StrainCollection':
def __add__(self, other) -> StrainCollection:
if isinstance(other, StrainCollection):
sc = StrainCollection()
for strain in self._strains:
Expand Down

0 comments on commit 62291dd

Please sign in to comment.