Skip to content

Commit 4ec466d

Browse files
committed
use @call to make the sentinel singleton
1 parent 034b1c7 commit 4ec466d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

unpythonic/seq.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from collections import namedtuple
1010
from unpythonic.env import env
11+
from unpythonic.misc import call
1112

1213
# evil inspect dependency, used only to provide informative error messages.
1314
from unpythonic.arity import arity_includes, UnknownArity
@@ -137,11 +138,11 @@ def pipe(value0, *bodys):
137138
x = update(x)
138139
return x
139140

140-
class get: # sentinel singleton with a nice repr
141+
@call # make a singleton
142+
class get: # sentinel with a nice repr
141143
"""Sentinel; pipe into this to exit a shell-like pipe and return the current value."""
142144
def __repr__(self):
143145
return "<sentinel for pipe exit>"
144-
get = get()
145146

146147
class piped:
147148
"""Shell-like piping syntax.

0 commit comments

Comments
 (0)