Skip to main content

pydantic-expost

from __future__ import annotations  # py 3.13-

from typing import Any, Self

from pydantic import validate_call, ConfigDict
from pydantic_expost import validate_call_expost


c = ConfigDict(arbitrary_types_allowed=True, validate_return=True)


try:
  @validate_call(config=c)
  def f(a: A, b: B) -> tuple[A, B]:
    return a, b
except:
  print('validate_call(f) --> raise')


@validate_call_expost(config=c)
def f(a: A, b: B) -> tuple[A, B]:
  return a, b
print('validate_call_expost(f) --> ok')


class A:

  try:
    @validate_call(config=c)
    def b(self: Any, b: B) -> Any:
      ...
  except:
    print('validate_call(A.b) --> raise')

  @validate_call_expost(config=c)
  def b(self: Any, b: B) -> Any:
    ...
  print('validate_call_expost(A.b) --> ok')

class B:
  ...


f(A(), B())
print('f(A(), B()) --> ok')

try:
  f(B(), A())    # raise
except:
  print('f(B(), A()) --> raise')

A().b(B())
print('A().b(B()) --> ok')

A.b('A', B())
print('A.b("A", B()) --> ok !')

try:
  A().b('B')
except:
  print('A().b("B") --> raise')

Metadata

Release files for pydantic-expost 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydantic-expost 0.2
File Size Uploaded Provenance Actions
pydantic_expost-0.2.tar.gz 3.0 kB Without provenance Details for pydantic_expost-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydantic-expost 0.2
File Interpreter ABI Platform Actions
pydantic_expost-0.2-py3-none-any.whl Python 3 none any Details for pydantic_expost-0.2-py3-none-any.whl

Total release size: 6.3 kB

Release files / pydantic_expost-0.2.tar.gz

Download URL pydantic_expost-0.2.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b8e0bb9782cf55f5b4c753e0e836855acbbf883fb2ec10435d9fd499e86b34f6
BLAKE2b-256 checksum
How to use checksums
cdba4323b360278e9cb6335226cfd00fc7f7c810dbef873acceb2ab4adf158c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.0

Release files / pydantic_expost-0.2-py3-none-any.whl

Download URL pydantic_expost-0.2-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
339df87c6b219ac695ced4331e5865e55e2b55cf4025153dcd731ad8b54ecd8a
BLAKE2b-256 checksum
How to use checksums
608d02f037ce430bff03b18793a46f5167ffa3aa179ae2d75f7672b4e8221568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.0

Security for pydantic-expost 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page