Skip to content

Commit edf398b

Browse files
committed
Use zip to merge two iterators
1 parent cc64295 commit edf398b

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)