Skip to content

Commit 9e5e9c5

Browse files
committed
unique method None value support added.
1 parent 1ba2fb5 commit 9e5e9c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crontools/crontab.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import tzlocal
88
from typing import Any, ClassVar, Dict, Generic, Iterator, Iterable, Optional, Type, TypeVar, Tuple
99

10+
SENTINEL = object()
11+
1012

1113
def unique(iterable: Iterable[Any]) -> Iterator[Any]:
1214
"""
@@ -18,7 +20,7 @@ def unique(iterable: Iterable[Any]) -> Iterator[Any]:
1820

1921
it = iter(iterable)
2022

21-
prev = None
23+
prev = SENTINEL
2224
for val in it:
2325
if val == prev:
2426
continue

0 commit comments

Comments
 (0)