Skip to content

Commit 5a19ba7

Browse files
committed
Fix #267: Replace timeout type from Optional[int] to Optional[float]
1 parent d7597a2 commit 5a19ba7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGES.rst

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Changes
1212

1313
- Refomat with ``black``
1414

15+
- Replace ``timeout`` type from ``Optional[int]`` to ``Optional[float]`` #267
16+
1517
0.5.0 (2020-04-23)
1618
------------------
1719

janus/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
T = TypeVar("T")
16-
OptInt = Optional[int]
16+
OptFloat = Optional[float]
1717

1818

1919
current_loop = getattr(asyncio, "get_running_loop", None)
@@ -265,7 +265,7 @@ def full(self) -> bool:
265265
"""
266266
return 0 < self._parent._maxsize <= self._parent._qsize()
267267

268-
def put(self, item: T, block: bool = True, timeout: OptInt = None) -> None:
268+
def put(self, item: T, block: bool = True, timeout: OptFloat = None) -> None:
269269
"""Put an item into the queue.
270270
271271
If optional args 'block' is true and 'timeout' is None (the default),
@@ -299,7 +299,7 @@ def put(self, item: T, block: bool = True, timeout: OptInt = None) -> None:
299299
self._parent._sync_not_empty.notify()
300300
self._parent._notify_async_not_empty(threadsafe=True)
301301

302-
def get(self, block: bool = True, timeout: OptInt = None) -> T:
302+
def get(self, block: bool = True, timeout: OptFloat = None) -> T:
303303
"""Remove and return an item from the queue.
304304
305305
If optional args 'block' is true and 'timeout' is None (the default),

0 commit comments

Comments
 (0)