Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Support include/exclude arguments with `__contains__`

#409Merged
Comparing
support-include-exclude-contains
(
0b0139c
) with
main
(
11bd0c7
)
CodSpeed Performance Gauge
0%
Untouched
85

Benchmarks

85 total
test_arguments
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+5%
29.8 µs28.3 µs
test_generator_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+3%
36.5 µs35.5 µs
test_core_json
tests/benchmarks/test_serialization_micro.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
+2%
101.4 µs99 µs
test_int_error
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
48.1 µs47.3 µs
test_chain_two_functions
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
38 µs37.6 µs
test_recursive_model_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
0%
436.7 µs435.1 µs
test_core_dict_filter
tests/benchmarks/test_serialization_micro.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
0%
85.9 µs85.6 µs
test_json_direct_list_str
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
211.5 µs210.9 µs
test_core_json_not_fs
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
0%
224.3 µs223.6 µs
test_model_exclude_unset_false
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
28 µs28 µs
test_list_of_dict_models_core
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
0%
128.4 µs128 µs
test_json_direct_list_int
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
191 µs190.7 µs
test_json_any_list_str
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
336.5 µs336 µs
test_python_json_list_int
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
164.1 µs163.9 µs
test_dict_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
0%
3.2 ms3.2 ms
test_model_list_core_json
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
206.2 µs206 µs
test_core_json_fs
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
0%
227.6 µs227.4 µs
test_json_any_list_int
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
312.7 µs312.3 µs
test_python_json_list_str
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
169.3 µs169.1 µs
test_build_schema
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
0%
813.3 µs812.5 µs
test_core_dict
tests/benchmarks/test_serialization_micro.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
0%
80.3 µs80.3 µs
test_set_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms
test_python_json_list_none
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
0%
138 µs137.9 µs
test_core_json_fs
tests/benchmarks/test_micro_benchmarks.py::TestModelLarge
CodSpeed Performance Gauge
0%
186.1 µs186 µs
test_many_models_core_dict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms

Commits

Click on a commit to change the comparison range
Base
main
11bd0c7
-0.06%
Reorder checks for performance
9d9a541
3 years ago
by dmontagu
+0.11%
reuse contains method attribute
114276a
3 years ago
by samuelcolvin
-0.4%
fix __contains__ logic
671afcf
3 years ago
by samuelcolvin
-0.08%
revert ununecessary changes
0b0139c
3 years ago
by samuelcolvin
© 2026 CodSpeed Technology
Home Terms Privacy Docs