PEP 618
E907044
PEP 618 is a Python Enhancement Proposal that introduced the `strict` parameter to the built-in `zip` function, enabling stricter handling of iterables with mismatched lengths.
Statements (39)
| Predicate | Object |
|---|---|
| instanceOf | Python Enhancement Proposal ⓘ |
| addsKeywordArgumentTo | zip(strict=...) ⓘ |
| affectsVersion | Python 3.10 NERFINISHED ⓘ |
| audience | Python developers ⓘ |
| backwardsCompatibility | non-strict zip calls behave as before ⓘ |
| category | Core Python NERFINISHED ⓘ |
| changesRuntimeBehaviorOf | zip when strict=True ⓘ |
| createdFor | CPython NERFINISHED ⓘ |
| defaultValueOf | strict=False ⓘ |
| definesAPI | zip(iter1, iter2, *iterables, strict=False) ⓘ |
| definesBehavior |
error on mismatched iterable lengths when strict=True
ⓘ
length-checking for zip iterables ⓘ |
| designDecision | raise error instead of silent truncation in strict mode ⓘ |
| documentationLocation | Python PEPs website NERFINISHED ⓘ |
| ensures | all iterables have the same length when strict=True ⓘ |
| errorType | ValueError on length mismatch in strict mode ⓘ |
| governs | behavior of built-in zip in strict mode ⓘ |
| hasKeyword |
iterables
ⓘ
length checking ⓘ strict ⓘ zip ⓘ |
| hasNumber | 618 ⓘ |
| hasTitle | Add Optional Length-Checking To zip ⓘ |
| impact | safer iteration over multiple sequences ⓘ |
| introducesParameter | strict ⓘ |
| isAccepted | True ⓘ |
| isPartOf | PEP index NERFINISHED ⓘ |
| language | English ⓘ |
| modifiesFunction | zip ⓘ |
| motivation |
detect bugs caused by silently truncated zip results
ⓘ
provide optional strict length checking for zip ⓘ |
| proposesChangeTo | Python language NERFINISHED ⓘ |
| rationale |
default zip behavior remains unchanged
ⓘ
strict mode is opt-in via keyword argument ⓘ |
| repository | https://peps.python.org/pep-0618/ ⓘ |
| scope | built-in functions ⓘ |
| status | Final ⓘ |
| targetImplementation | CPython interpreter NERFINISHED ⓘ |
| type | Standards Track ⓘ |
Referenced by (1)
Full triples — surface form annotated when it differs from this entity's canonical label.