casnetwork.blogg.se

Python latest stable version
Python latest stable version





python latest stable version

In Python 3.10 > list(zip(,, strict=True)) Traceback (most recent call last). Read more on this issue at PEP 618.īefore Python 3.10 > list(zip(, ))

python latest stable version

Given the intuitiveness of zipping an equal number of items, I like this feature as it wakes you up to re-inspect your input.

python latest stable version

By contrast, Python 3.10 will raise a ValueError. Until Python 3.9, if you are zipping two lists of unequal length, you would get the output with the length equal to the smaller list.Īs you can see in the following example, before Python 3.10, the zip() function ignored the unmatched 'D' in the first list. If you pass strict=True, the iterables that you are zipping must be of equal length, or else a ValueError will be raised. A new, optional keyword argument strict will be added to the zip function.







Python latest stable version