Skip to content

Commit c31fbcc

Browse files
author
czheo
committed
2 parents 26f87da + 2306c1c commit c31fbcc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ from syntax_sugar import is_a, has, to, step, drop
118118
1 /is_a/ int
119119
# equivalent to `isinstance(1, int)`
120120

121+
1 /as_a/ str
122+
# "1"
123+
121124
range(10) /has/ '__iter__'
122125
# equivalent to `hasattr(range(10), "__iter__")`
123126

@@ -162,6 +165,9 @@ for i in 1 /to/ INF:
162165
# there is a `take` functon which is similar to itertools.islice
163166
# return [1, 2, 3, 4, 5]
164167

168+
1 /to/ ... /take/ 5 /as_a/ list
169+
# ... is equivalent to INF
170+
165171
0 /to/ -INF /step/ 2 /take/ 5 /as_a/ list
166172
# also works with negative infinity.
167173
# return [0, -2, -4, -6, -8]

0 commit comments

Comments
 (0)