Skip to content

Commit 6e8b47e

Browse files
author
Joel Collins
committed
Improved type annotations
1 parent 37919b1 commit 6e8b47e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/labthings/marshalling/marshalling.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from collections.abc import Mapping
22
from functools import wraps
3-
from typing import Callable, Dict, Tuple, Union
3+
from typing import Callable, Dict, Tuple, Union, Optional
44

55
from marshmallow import Schema as _Schema
66
from werkzeug.wrappers import Response as ResponseBase
@@ -10,7 +10,9 @@
1010
from ..utilities import unpack
1111

1212

13-
def schema_to_converter(schema: Union[Schema, Field, Dict[str, Union[Field, type]]]):
13+
def schema_to_converter(
14+
schema: Union[Schema, Field, Dict[str, Union[Field, type]]]
15+
) -> Optional[Callable]:
1416
"""Convert a schema into a converter function,
1517
which takes a value as an argument and returns
1618
marshalled data

0 commit comments

Comments
 (0)