Skip to content

Commit

Permalink
add python type information for MessageQueue class
Browse files Browse the repository at this point in the history
  • Loading branch information
sillydan1 committed Sep 21, 2024
1 parent 00e5986 commit c5a3259
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions posix_ipc.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from collections.abc import Callable
from typing import Any

class MessageQueue:
def __init__(
self,
name: str | None,
flags: int = ...,
mode: int = ...,
max_messages: int = ...,
max_message_size: int = ...,
read: bool = ...,
write: bool = ...,
) -> None: ...
def send(self, message: str | bytes, timeout: float | None = ..., priority: int = ...) -> None: ...
def receive(self, timeout: float | None = ...) -> bytes: ...
def request_notification(self, notification: int | tuple[Callable[[Any], None], Any] | None = ...) -> None: ...
def close(self) -> None: ...
def unlink(self) -> None: ...
Empty file added py.typed
Empty file.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@
classifiers=classifiers,
license=license,
keywords=keywords,
ext_modules=ext_modules
ext_modules=ext_modules,
package_data={"posix_ipc": ["*.pyi", "py.typed"]}
)

0 comments on commit c5a3259

Please sign in to comment.