mirror of
https://github.com/kennethreitz/pydantic.git
synced 2026-06-05 23:00:18 +00:00
e7227db41a
* starting insert prints * working exec_script * remove prints, fix exec_examples.py * more cleanup of examples, better model printing * upgrade netlify runtime * extra docs deps * few more small tweaks
12 lines
251 B
Python
12 lines
251 B
Python
from pydantic import BaseModel, HttpUrl
|
|
|
|
class MyModel(BaseModel):
|
|
url: HttpUrl
|
|
|
|
m1 = MyModel(url='http://puny£code.com')
|
|
print(m1.url)
|
|
print(m1.url.host_type)
|
|
m2 = MyModel(url='https://www.аррӏе.com/')
|
|
print(m2.url)
|
|
print(m2.url.host_type)
|