pydantic
pydantic
BlogDocsChangelog

Use positional-only `self` in `BaseModel` constructor, so no field name can ever conflict with it.

#8072Merged
Comparing
ariebovenberg:basemodel-self
(
4b3110a
) with
main
(
eb90b59
)
CodSpeed Performance Gauge
0%
Untouched
10

Benchmarks

Passed

test_north_star_validate_python
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
+1%
38 ms37.6 ms
test_north_star_validate_json
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
+1%
74.3 ms73.8 ms
test_north_star_validate_json_strict
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
+1%
72.9 ms72.5 ms
test_north_star_dump_python
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
0%
15.8 ms15.8 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_simple.py
CodSpeed Performance Gauge
0%
215.3 ms214.7 ms
test_north_star_validate_python_strict
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
0%
23.2 ms23.2 ms
test_north_star_dump_json
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
0%
39 ms39 ms
test_fastapi_startup_perf
tests/benchmarks/test_fastapi_startup_generics.py
CodSpeed Performance Gauge
0%
573.8 ms574.5 ms
test_north_star_json_dumps
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
-1%
36.7 ms36.9 ms
test_north_star_json_loads
tests/benchmarks/test_north_star.py
CodSpeed Performance Gauge
-1%
18.1 ms18.3 ms

Commits

Click on a commit to change the comparison range
Base
main
eb90b59
+0.13%
Replace __pydantic_self__ with positional-only self
4b3110a
2 years ago
by ariebovenberg
© 2025 CodSpeed Technology
Home Terms Privacy Docs