Support bytes arguments in float() #1120
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 197 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.316
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1120"
general
weight: 0.35
jaheba
float()currently accepts numeric values and strings but rejects bytes, so an ordinaryfloat(b"1.5")raisesTypeErrorwhere CPython returns1.5.This adds bytes conversion for both literal and dynamically allocated inputs, sharing the existing string parser while retaining ASCII-only bytes grammar and the original bytes representation in
ValueErrormessages. Regression coverage includes whitespace, underscores, exponents, infinity/NaN, signed zero, malformed literals, embedded NULs, non-ASCII bytes and quoted/escaped error inputs. The limitations page records the remaining Unicode-digit difference for string arguments.Refs #983, the bytes-conversion part of item 5 only. Other reported differences and the separate float-rounding PR are outside this change.
Validation on Linux with CPython 3.14.9:
TypeErroron unmodified Monty.make format-rs,make lint-rs(including all features), andmake lint-pypass.make test-docspasses: 64 Python examples pass and 14 are explicitly skipped by the existing upstream markers; Rust workspace doctests pass.Codex assisted with implementation and test execution. A separate Codex agent independently reviewed the code, regression coverage and documentation, with no blocking findings. No hosted models or external application services were used for verification. macOS and Windows were not tested locally.