Skip to content

Commit fa0e500

Browse files
committed
feat(Lib/os): supports_*.issupperset
1 parent 4531bb9 commit fa0e500

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/pylib/Lib/os_impl/have_functions.nim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ macro contains*(s: HaveFunc; fns: varargs[untyped]): bool =
5151
## used for `{xxx, ...} <= s`
5252
multiContainsImpl(s, fns)
5353

54-
macro `>=`*(s: HaveFunc; fns: untyped): bool =
54+
macro issuperset*(s: HaveFunc; fns: untyped): bool =
5555
## used for `{xxx, ...} <= s`
5656
multiContainsImpl(s, fns)
5757

58+
template `>=`*(s: HaveFunc, fns): bool =
59+
bind issuperset
60+
s.issuperset(fns)
61+
5862
# Not work for even `(x, ...) <= s`:
59-
template `<=`*(fns: untyped; s: untyped): bool = bind `>=`; s>=fns
63+
template `<=`*(fns: untyped; s: HaveFunc): bool =
64+
bind issuperset
65+
s.issuperset(fns)
6066

6167
const MS_WINDOWS = defined(windows)
6268
template reset_set(name){.dirty.} =

0 commit comments

Comments
 (0)