Skip to content

Commit

Permalink
docs: update NoCast docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Jul 9, 2024
1 parent ffdc391 commit f2828cc
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions faststream/utils/no_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,15 @@
class NoCast(CustomField):
"""A class that represents a custom field without casting.
Methods:
__init__ : Initializes the NoCast object.
use : Returns the provided keyword arguments as a dictionary.
You can use it to annotate fields, that should not be casted.
Usage:
`data: Annotated[..., NoCast()]`
"""

def __init__(self) -> None:
"""Initialize the NoCast object."""
super().__init__(cast=False)

def use(self, **kwargs: Any) -> AnyDict:
"""Return a dictionary containing the keyword arguments passed to the function.
Args:
**kwargs: Keyword arguments
Returns:
Dictionary containing the keyword arguments
"""
return kwargs

0 comments on commit f2828cc

Please sign in to comment.