Avatar for the hgrecco user
hgrecco
pint
BlogDocsChangelog

Fix Unit.__eq__ with strings by parsing via registry

#2292
Comparing
andrewgsavage:fix/unit-eq-string-634
(
48f631d
) with
master
(
907619f
)
CodSpeed Performance Gauge
+1%
Untouched
448
Skipped
448

Benchmarks

896 total
test_op2[add-keys22]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+6%
33.4 µs31.5 µs
test_op2[add-keys18]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+5%
32.2 µs30.6 µs
test_op2[eq-keys3]
pint/testsuite/benchmarks/test_30_numpy.py
CodSpeed Performance Gauge
+5%
8.1 µs7.7 µs
test_op2[mul-keys14]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
12.6 µs12.1 µs
test_op2[sub-keys10]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
32.5 µs31.2 µs
test_op2[less-keys2]
pint/testsuite/benchmarks/test_30_numpy.py
CodSpeed Performance Gauge
+4%
48 µs46 µs
test_op2[truediv-keys34]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
13.5 µs12.9 µs
test_op2[add-keys6]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
32 µs30.8 µs
test_op2[sub-keys16]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
11.6 µs11.2 µs
test_op1[neg-complex_kilometer]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
4.6 µs4.4 µs
test_op2[add-keys17]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
32.4 µs31.2 µs
test_create_default_registry_use_cache
pint/testsuite/benchmarks/test_05_registry_creation.py
CodSpeed Performance Gauge
+4%
15.3 ms14.8 ms
test_op2[eq-keys20]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
14.9 µs14.3 µs
test_convert_from_uc[False-key0]
pint/testsuite/benchmarks/test_10_registry.py
CodSpeed Performance Gauge
+4%
9.2 µs8.8 µs
test_op2[sub-keys24]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+4%
11.6 µs11.2 µs
test_wrapper_nonstrict[float_meter]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
2.8 µs2.7 µs
test_op2[sub-keys5]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
32 µs31 µs
test_op1[neg-int_meter]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
4.6 µs4.4 µs
test_op1[neg-float_kilometer]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
4.6 µs4.5 µs
test_op2[add-keys20]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
32.1 µs31.1 µs
test_op1[neg-float_meter]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
4.6 µs4.5 µs
test_op2[sub-keys22]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
32 µs31 µs
test_build_by_mul[int]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
5.4 µs5.2 µs
test_op2[add0-keys1]
pint/testsuite/benchmarks/test_30_numpy.py
CodSpeed Performance Gauge
+3%
36.7 µs35.5 µs
test_op2[add-keys11]
pint/testsuite/benchmarks/test_20_quantity.py
CodSpeed Performance Gauge
+3%
11.7 µs11.4 µs

Commits

Click on a commit to change the comparison range
Base
master
907619f
+0.6%
Fix Unit.__eq__ with strings by parsing via registry (gh-634)
d62ef81
4 days ago
by andrewgsavage
+0.34%
Use str comparison first, fall back to registry parse for Unit.__eq__ string
48f631d
4 days ago
by andrewgsavage
© 2026 CodSpeed Technology
Home Terms Privacy Docs