X Tutup
Skip to content

Commit deb6416

Browse files
committed
Define a protocol for paster implementations
1 parent 2299612 commit deb6416

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bpython/paste.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
import errno
2424
import subprocess
25-
from typing import Tuple
25+
from typing import Optional, Tuple, Protocol
2626
from urllib.parse import urljoin, urlparse
2727

2828
import requests
@@ -36,6 +36,11 @@ class PasteFailed(Exception):
3636
pass
3737

3838

39+
class Paster(Protocol):
40+
def paste(self, s: str) -> Tuple[str, Optional[str]]:
41+
...
42+
43+
3944
class PastePinnwand:
4045
def __init__(self, url: str, expiry: str) -> None:
4146
self.url = url

0 commit comments

Comments
 (0)
X Tutup