File: pass_through.py

package info (click to toggle)
python-apischema 0.18.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,608 kB
  • sloc: python: 15,266; sh: 7; makefile: 7
file content (10 lines) | stat: -rw-r--r-- 330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
from collections.abc import Collection
from uuid import UUID, uuid4

from apischema import PassThroughOptions, serialization_method

uuids_method = serialization_method(
    Collection[UUID], pass_through=PassThroughOptions(collections=True, types={UUID})
)
uuids = [uuid4() for _ in range(5)]
assert uuids_method(uuids) is uuids