Skip to content

Commit

Permalink
chore: copy module docstrings into python stub files (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Nov 21, 2024
1 parent 8996696 commit 07ac20c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 1 deletion.
4 changes: 4 additions & 0 deletions a_sync/a_sync/_helpers.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
This module provides utility functions for handling asynchronous operations
and converting synchronous functions to asynchronous ones.
"""
from a_sync._typing import *
from a_sync import exceptions as exceptions

Expand Down
10 changes: 10 additions & 0 deletions a_sync/a_sync/abstract.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
"""
This module provides an abstract base class for defining asynchronous and synchronous behavior.
The :class:`ASyncABC` class uses the :class:`ASyncMeta` metaclass to facilitate the creation of classes
that can operate in both asynchronous and synchronous contexts. It provides concrete methods to determine
the execution mode based on flags and keyword arguments.
Note: It is recommended to use :class:`ASyncGenericBase` for most use cases. This class
is intended for more custom implementations if necessary.
"""
from a_sync._typing import *
import abc
import functools
Expand Down
7 changes: 7 additions & 0 deletions a_sync/a_sync/method.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
This module provides classes for implementing dual-functional sync/async methods in Python.
It includes descriptors and bound methods that can be used to create flexible
asynchronous interfaces, allowing methods to be called both synchronously and
asynchronously based on various conditions and configurations.
"""
from a_sync._typing import *
import functools
import weakref
Expand Down
5 changes: 5 additions & 0 deletions a_sync/asyncio/create_task.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
This module extends :func:`asyncio.create_task` to support any :class:`Awaitable`,
manage task lifecycle, and enhance error handling.
"""

from a_sync._typing import *
import asyncio

Expand Down
4 changes: 4 additions & 0 deletions a_sync/asyncio/gather.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
This module provides an enhanced version of :func:`asyncio.gather`.
"""

from a_sync._typing import *
from typing import Any, Awaitable, Dict, List, Mapping, overload

Expand Down
5 changes: 5 additions & 0 deletions a_sync/primitives/_debug.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
This module provides a mixin class used to facilitate the creation of debugging daemons in subclasses.
The mixin provides a framework for managing a debug daemon task, which can be used to emit rich debug logs from subclass instances whenever debug logging is enabled. Subclasses must implement the specific logging behavior.
"""
import abc
from a_sync.primitives._loggable import _LoggerMixin

Expand Down
3 changes: 3 additions & 0 deletions a_sync/primitives/_loggable.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
This module provides a mixin class to add debug logging capabilities to other classes.
"""
from functools import cached_property as cached_property
from logging import Logger

Expand Down
9 changes: 9 additions & 0 deletions a_sync/task.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
"""
This module provides asynchronous task management utilities, specifically focused on creating and handling mappings of tasks.
The main components include:
- TaskMapping: A class for managing and asynchronously generating tasks based on input iterables.
- TaskMappingKeys: A view to asynchronously iterate over the keys of a TaskMapping.
- TaskMappingValues: A view to asynchronously iterate over the values of a TaskMapping.
- TaskMappingItems: A view to asynchronously iterate over the items (key-value pairs) of a TaskMapping.
"""
from a_sync._typing import *
import asyncio
from _typeshed import Incomplete
Expand Down
1 change: 0 additions & 1 deletion a_sync/task.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import a_sync.asyncio
from a_sync import exceptions
from a_sync._typing import *
from a_sync.a_sync._kwargs cimport get_flag_name
from a_sync.a_sync.base import ASyncGenericBase
from a_sync.a_sync.function import ASyncFunction
from a_sync.a_sync.method import (
ASyncBoundMethod,
Expand Down

0 comments on commit 07ac20c

Please sign in to comment.