You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the next release will be 2.0.0 (#238), would this be a good time to do this?
The idea is to use rb_keyword_given_p() instead of the type of the last argument. Only Ruby keyword arguments would become Python keyword arguments, and a Hash in the positional arguments would be passed as a dict:
Pandas::Series.new({c: 100,b: 200,a: 300})# a dict; no trailing {} neededf.(a: 1)# keyword arguments, as todayf.(**opts)# keyword arguments, as today
It would need Ruby 2.7 or later, and the Ruby-side methods that forward *args to the C side (PyObjectWrapper#method_missing, #call, PyTypeObjectWrapper#new, and the methods PyCall::Import defines) would need ruby2_keywords. Code that passes f({a: 1}) or f(opts) meaning keyword arguments would need f(a: 1) or f(**opts), the same migration as Ruby 3.
Activity
Mark24Code commentedon Apr 21, 2023
Same problem +1
mrkn commentedon Aug 25, 2023
We can drop Ruby 2.7 support now.
himotoyoshi commentedon Nov 17, 2026
Since the next release will be 2.0.0 (#238), would this be a good time to do this?
The idea is to use
rb_keyword_given_p()instead of the type of the last argument. Only Ruby keyword arguments would become Python keyword arguments, and a Hash in the positional arguments would be passed as a dict:It would need Ruby 2.7 or later, and the Ruby-side methods that forward
*argsto the C side (PyObjectWrapper#method_missing,#call,PyTypeObjectWrapper#new, and the methodsPyCall::Importdefines) would needruby2_keywords. Code that passesf({a: 1})orf(opts)meaning keyword arguments would needf(a: 1)orf(**opts), the same migration as Ruby 3.kou commentedon Nov 17, 2026
We don't need to use
ruby2_keywordsbecause we drop support for Ruby 2.7.