JuliaPy / JuliaPy/PyCall.jl

Make keyword/positional arguments easier

オープン
#701 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
1.5k
フォーク
186
PR マージ指標
30日以内にマージされた PR はありません

説明

In Python, most arguments can be specified either positionally or as keywords. This is important when you're defining functions that have to conform to an existing interface (and the users of that interface use both positional and keyword forms of the function).

```python
def myfunc(foo, bar, spam=None, *, eggs=123):
return foo, bar, spam, eggs

myfunc(1, 2)
myfunc(foo=1, bar=2)
myfunc(1, 2, eggs=3)
# etc.
```

Currently, this is a pain in PyCall: [look at this monster!](https://github.com/JuliaPy/PyInteract.jl/blob/118f5ae219eab562691b65415d8c221e41612734/src/PyInteract.jl#L35-L49)

I tried to write a macro that does that automagically but PyCall doesn't seem to like macros inside `@pydef`s. Is there any way to make this easier/can we make one?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reading the argument-handling code in src/PyInteract.jl at the linked lines and inspect how @pydef processes methods. Check whether PyCall supports macros inside @pydef and how positional and keyword arguments are currently represented. The issue does not define a concrete implementation or acceptance criteria, so the expected completion conditions need clarification.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia, python
領域
api
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。