PythonCall.jl icon indicating copy to clipboard operation
PythonCall.jl copied to clipboard

Allow pydict accept Pair args

Open mkitti opened this issue 7 months ago • 1 comments

Create a method pydict(pairs::Pair...) similar to Dict(::Pair...).

This allow for the following usage.

julia> using PythonCall

julia> Dict("a" => 5, "b" => 6)
Dict{String, Int64} with 2 entries:
  "b" => 6
  "a" => 5

julia> pydict("a" => 5, "b" => 6)
Python: {'a': 5, 'b': 6}

mkitti avatar May 20 '25 19:05 mkitti

@cjdoris There seems to be an issue with Python 3.13 per the failing test.

xref: https://github.com/JuliaLang/julia/issues/58475

mkitti avatar May 20 '25 22:05 mkitti

Good idea, thanks.

cjdoris avatar Sep 17 '25 18:09 cjdoris