Skip to content

Commit

Permalink
fix: dict init not compile suddenly
Browse files Browse the repository at this point in the history
  • Loading branch information
litlighilit committed Aug 7, 2024
1 parent 7204aed commit a5ebeb6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pylib/builtins/dict.nim
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func toPyDict*[K, V](x: openArray[(K, V)]): PyDict[K, V] =
func toPyDict*[K, V](x:
not openArray[(K, V)] and Iterable[(K, V)]): PyDict[K, V] =
result = newPyDictImpl[K, V]()
for k, v in x:
for (k, v) in x:
result[k] = v

func copy*[K, V](self: PyDict[K, V]): PyDict[K, V] =
Expand Down
2 changes: 1 addition & 1 deletion src/pylib/builtins/dict_decl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ template newPyDictImpl*[K, V](x: int): untyped =
bind initOrderedTable
PyDict[K, V](data: initOrderedTable[K, V](x))

template newPyDictImpl*[K, V](x: varargs): untyped =
template newPyDictImpl*[K, V](x: openArray[(K, V)] = []): untyped =
## zero or one arg
## shall support `[]`, `{k:v, ...}`, `@[(k, v),...]`
bind toOrderedTable
Expand Down

0 comments on commit a5ebeb6

Please sign in to comment.