Skip to content

Commit

Permalink
Improved type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jan 5, 2021
1 parent 37919b1 commit 6e8b47e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/labthings/marshalling/marshalling.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Mapping
from functools import wraps
from typing import Callable, Dict, Tuple, Union
from typing import Callable, Dict, Tuple, Union, Optional

from marshmallow import Schema as _Schema
from werkzeug.wrappers import Response as ResponseBase
Expand All @@ -10,7 +10,9 @@
from ..utilities import unpack


def schema_to_converter(schema: Union[Schema, Field, Dict[str, Union[Field, type]]]):
def schema_to_converter(
schema: Union[Schema, Field, Dict[str, Union[Field, type]]]
) -> Optional[Callable]:
"""Convert a schema into a converter function,
which takes a value as an argument and returns
marshalled data
Expand Down

0 comments on commit 6e8b47e

Please sign in to comment.