JuliaPy / JuliaPy/PyCall.jl

Make `PyObject` parametric?

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

説明

Thinking about conversion between Julia and Python values and semantics, I wonder if we could make `PyObject` parametric, so make it `PyObject{P <: PyConversionPolicy}` where `P` encodes how we want to interpret the object.

For example, `PyObject{Nice}` would be equivalent to `PyObject` as it is now, with user-friendly automatic conversions. `PyObject{Raw}` would perform no automatic conversion at all, which would be useful for wrapping Python packages into Julia, where complete control is required. Other possibilities could be `PyObject{Numpy}` which converts Julia arrays to numpy arrays instead of to lists, for example.

This policy parameter would be inherited in a natural way, so operations on objects with the same policy produce an object with that policy.

I don't know if the effort to implement this would be worth it, since you can already achieve the same things using PyCall's clunkier syntax, but I just wanted to gather opinions and suggestions.

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

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

調査の方向性

Start by reading the existing PyObject conversion behavior and the PyCall syntax the issue compares against. Clarify whether a PyConversionPolicy with Nice, Raw, and Numpy variants is wanted, including policy inheritance across operations; done would require agreement on the design and its conversion semantics.

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

評価

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

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

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