mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Allow Any return value for callbacks in retrbinary etc (#1567)
Fixes #1258
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Stubs for ftplib (Python 2.7/3)
|
||||
import sys
|
||||
from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, TypeVar, Generic
|
||||
from typing import Optional, BinaryIO, Tuple, TextIO, Iterable, Callable, List, Union, Iterator, Dict, Text, TypeVar, Generic, Any
|
||||
from types import TracebackType
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
@@ -82,11 +82,11 @@ class FTP:
|
||||
# In practice, `rest` rest can actually be anything whose str() is an integer sequence, so to make it simple we allow integers.
|
||||
def ntransfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> Tuple[socket, int]: ...
|
||||
def transfercmd(self, cmd: Text, rest: Optional[_IntOrStr] = ...) -> socket: ...
|
||||
def retrbinary(self, cmd: Text, callback: Callable[[bytes], None], blocksize: int = ..., rest: Optional[_IntOrStr] = ...) -> str: ...
|
||||
def storbinary(self, cmd: Text, fp: BinaryIO, blocksize: int = ..., callback: Optional[Callable[[bytes], None]] = ..., rest: Optional[_IntOrStr] = ...) -> str: ...
|
||||
def retrbinary(self, cmd: Text, callback: Callable[[bytes], Any], blocksize: int = ..., rest: Optional[_IntOrStr] = ...) -> str: ...
|
||||
def storbinary(self, cmd: Text, fp: BinaryIO, blocksize: int = ..., callback: Optional[Callable[[bytes], Any]] = ..., rest: Optional[_IntOrStr] = ...) -> str: ...
|
||||
|
||||
def retrlines(self, cmd: Text, callback: Optional[Callable[[str], None]] = ...) -> str: ...
|
||||
def storlines(self, cmd: Text, fp: BinaryIO, callback: Optional[Callable[[bytes], None]] = ...) -> str: ...
|
||||
def retrlines(self, cmd: Text, callback: Optional[Callable[[str], Any]] = ...) -> str: ...
|
||||
def storlines(self, cmd: Text, fp: BinaryIO, callback: Optional[Callable[[bytes], Any]] = ...) -> str: ...
|
||||
|
||||
def acct(self, password: Text) -> str: ...
|
||||
def nlst(self, *args: Text) -> List[str]: ...
|
||||
|
||||
Reference in New Issue
Block a user