Skip to content

Commit

Permalink
fix CI: dict
Browse files Browse the repository at this point in the history
  • Loading branch information
litlighilit committed Apr 28, 2024
1 parent 4d61a13 commit 2166259
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/pylib/builtins/dict.nim
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,18 @@ macro dict*(kwargs: varargs[untyped]): PyDict =
error "use emptyPyDict" # TODO: support it
of 1:
let arg = kwargs[0]
if arg.kind == nnkExprEqExpr:
dictByKw kwargs
else:
newCall(PyDictProc, arg)
result =
if arg.kind == nnkExprEqExpr:
dictByKw kwargs
else:
newCall(PyDictProc, arg)
else:
let first = kwargs[0]
if first.kind == nnkExprEqExpr:
dictByKw kwargs
else:
dictByIterKw(first, kwargs[1..^1])
result =
if first.kind == nnkExprEqExpr:
dictByKw kwargs
else:
dictByIterKw(first, kwargs[1..^1])

macro update*(self: PyDict, args: varargs[untyped]) =
## `d.update(iterable, **kw)` or
Expand Down

0 comments on commit 2166259

Please sign in to comment.