mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
c24d33e5f1
* Generate docs exampels for Python 3.10 and above Code quality is not great and main intent here is to show the result. * Fix docs build on 3.9 * Build docs on 3.10 * What's Python 3.1? * Create temp dir if not exists * Refactor and improve imlementetion * Keep runtime typing in examples * Revert unrelated formatting changes * Add changes file * Allow specifying requirements in examples * Pin autoflake and pyupgrade * Add docs/build to Makefile lint/format/mypy * ignore_missing_imports for ansi2html and devtools * Add .tmp-projections to .gitignore * Remove dont-upgrade now when Pattern is supported * Update postponed evaluation examples Co-authored-by: Samuel Colvin <s@muelcolvin.com>
14 lines
271 B
Python
14 lines
271 B
Python
from __future__ import annotations
|
|
from pydantic import BaseModel
|
|
from pydantic import HttpUrl # HttpUrl is defined in the module's global scope
|
|
|
|
|
|
def this_works():
|
|
class Model(BaseModel):
|
|
a: HttpUrl
|
|
|
|
print(Model(a='https://example.com'))
|
|
|
|
|
|
this_works()
|