Skip to content

Commit 71c69f4

Browse files
committed
Use zip to merge two iterators
1 parent fe980b1 commit 71c69f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/semver/version.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ def _check_types(*args):
134134
(int, str, bytes), # major
135135
(int, str, bytes), # minor
136136
(int, str, bytes), # patch
137-
(str, bytes, int, type(None)), # prerelease
138-
(str, bytes, int, type(None)), # build
137+
(int, str, bytes, type(None)), # prerelease
138+
(int, str, bytes, type(None)), # build
139139
)
140140
return [
141-
isinstance(item, allowed_types_in_args[i])
142-
for i, item in enumerate(args)
141+
isinstance(item, expected_type)
142+
for item, expected_type in zip(args, allowed_types_in_args)
143143
]
144144

145145
cls = self.__class__

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy