Skip to content

Commit

Permalink
Take a Collection for targets in extract/read.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfi1 committed Jan 26, 2024
1 parent 8d0bcf2 commit 9c3f5f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py7zr/py7zr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import sys
from multiprocessing import Process
from threading import Thread
from typing import IO, Any, BinaryIO, Dict, List, Optional, Tuple, Type, Union
from typing import IO, Any, BinaryIO, Dict, Collection, List, Optional, Tuple, Type, Union

import multivolumefile

Expand Down Expand Up @@ -527,7 +527,7 @@ def _real_get_contents(self, password) -> None:
def _extract(
self,
path: Optional[Any] = None,
targets: Optional[List[str]] = None,
targets: Optional[Collection[str]] = None,
return_dict: bool = False,
callback: Optional[ExtractCallback] = None,
) -> Optional[Dict[str, IO[Any]]]:
Expand Down Expand Up @@ -979,11 +979,11 @@ def extractall(self, path: Optional[Any] = None, callback: Optional[ExtractCallb
"""
self._extract(path=path, return_dict=False, callback=callback)

def read(self, targets: Optional[List[str]] = None) -> Optional[Dict[str, IO[Any]]]:
def read(self, targets: Optional[Collection[str]] = None) -> Optional[Dict[str, IO[Any]]]:
self._dict = {}
return self._extract(path=None, targets=targets, return_dict=True)

def extract(self, path: Optional[Any] = None, targets: Optional[List[str]] = None) -> None:
def extract(self, path: Optional[Any] = None, targets: Optional[Collection[str]] = None) -> None:
self._extract(path, targets, return_dict=False)

def reporter(self, callback: ExtractCallback):
Expand Down

0 comments on commit 9c3f5f7

Please sign in to comment.