pycall.rb icon indicating copy to clipboard operation
pycall.rb copied to clipboard

Keyword argument handling on Ruby 2.7

Open mrkn opened this issue 4 years ago • 2 comments

We can remove the last empty Hash in the following case in Ruby 2.7 because we can distinguish arguments of Hash and keyword arguments in Ruby 2.7.

>> s4 = Pandas::Series.new({c: 100, b: 200, a: 300}, {})
=>
c    100
b    200
a    300
dtype: int64

>> Pandas::Series.new({c: 100, b: 200, a: 300})
Traceback (most recent call last):
        6: from /Users/mrkn/.rbenv/versions/2.7/bin/irb:23:in `<main>'
        5: from /Users/mrkn/.rbenv/versions/2.7/bin/irb:23:in `load'
        4: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/irb-1.2.3/exe/irb:11:in `<top (required)>'
        3: from (irb):28
        2: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pycall-1.3.0/lib/pycall/pytypeobject_wrapper.rb:24:in `new'
        1: from /Users/mrkn/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/pycall-1.3.0/lib/pycall/pytypeobject_wrapper.rb:24:in `call_object'
PyCall::PyError (<class 'TypeError'>: __init__() got an unexpected keyword argument 'c')

mrkn avatar Apr 22 '20 01:04 mrkn

Same problem +1

Mark24Code avatar Apr 21 '23 09:04 Mark24Code

We can drop Ruby 2.7 support now.

mrkn avatar Aug 25 '23 02:08 mrkn