Avatar for the pydantic user
pydantic
pydantic-core
BlogDocsChangelog

Add lax_str and lax_int support for enum values not inherited from str/int

#1015Merged
Comparing
michaelhly:enum-lax-int-lax-str
(
75d22a6
) with
main
(
23d1065
)
CodSpeed Performance Gauge
-22%
Improvement
2
Regression
2
Untouched
136

Benchmarks

140 total
test_dont_raise_error
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-22%
19.3 µs24.7 µs
test_dont_raise_error_no_info
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
-13%
17.3 µs20 µs
test_decimal_from_string_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDecimal
CodSpeed Performance Gauge
+24%
40.2 µs32.4 µs
test_complete_core_lax
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+13%
441.1 µs388.9 µs
test_generator_rust
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+7%
22.5 µs21 µs
test_model_instance_abc
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+5%
34.4 µs32.9 µs
test_to_string_direct
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
22.6 µs21.9 µs
test_to_string_format
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
27.5 µs26.7 µs
test_date_from_datetime
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkDateX
CodSpeed Performance Gauge
+3%
27.7 µs26.9 µs
test_core_model_py_extra
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+3%
34.7 µs33.7 µs
test_core_str
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+3%
42.8 µs41.7 µs
test_generator_python
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
27.1 µs26.5 µs
test_model_instance
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
32.8 µs32.1 µs
test_validate_literal[python-few_str_enum]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
20.5 µs20.1 µs
test_uuid_from_string_core
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+2%
44.1 µs43.3 µs
test_dict_of_ints_core_json
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+2%
2.8 ms2.8 ms
test_complete_core_json
tests/benchmarks/test_complete_benchmark.py
CodSpeed Performance Gauge
+2%
787.2 µs773.1 µs
test_core_dict
tests/benchmarks/test_serialization_micro.py::TestBenchmarkSimpleModel
CodSpeed Performance Gauge
+1%
80.4 µs79.3 µs
test_core_root_model
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
42.1 µs41.5 µs
test_many_models_core_dict
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
850.6 µs839.8 µs
test_validate_literal[python-few_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.3 µs14.1 µs
test_model_core_json
tests/benchmarks/test_micro_benchmarks.py::TestBenchmarkUUID
CodSpeed Performance Gauge
+1%
53.7 µs53.1 µs
test_int_error
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
52.6 µs52 µs
test_core_model_json_extra
tests/benchmarks/test_serialization_micro.py
CodSpeed Performance Gauge
+1%
34.2 µs33.8 µs
test_validate_literal[python-many_ints]
tests/benchmarks/test_micro_benchmarks.py
CodSpeed Performance Gauge
+1%
14.4 µs14.2 µs

Commits

Click on a commit to change the comparison range
Base
main
23d1065
-56.5%
ob_type: Fix bug
a25c916
2 years ago
by michaelhly
-0.14%
clean up
62c0691
2 years ago
by michaelhly
+56.82%
only import enum module once
fcd9a42
2 years ago
by michaelhly
-16.09%
lint
2543f2a
2 years ago
by michaelhly
+16.47%
Use interned strings
79277fc
2 years ago
by michaelhly
-0.87%
Merge remote-tracking branch 'origin/main' into enum-lax-int-lax-str
28a1221
2 years ago
by michaelhly
-21.4%
Implemented suggested fix for is_enum check on ob_type
75d22a6
2 years ago
by michaelhly
© 2026 CodSpeed Technology
Home Terms Privacy Docs