JuliaPy / JuliaPy/PyCall.jl

PyDict now a possible bug, on current Python in Ubuntu and Python 3.7 according to docs

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

説明

Since as of Python 3.7 Python's dict is ordered (and seemingly backported in Ubuntu at least, i.e. for Python 3.6), does PyDict need to be change here (at least documented)?

I noticed "This returns a PyDict, which is a no-copy wrapper around a Python dictionary." and that OrderedCollections.jl isn't used for OrderedDict (until I get it into Base as the default), do we need to change stuff here?

Even for older Python versions that do not use ordered by default (if there are any such still in use), I think it may make sense to convert to OrderedDict.

https://docs.python.org/3.6/tutorial/datastructures.html#dictionaries

```
julia> using PyCall

julia> py"""
tel = {'jack': 4098, 'sape': 4139}
tel['guido'] = 4127
"""

julia> tel = py"tel"
Dict{Any, Any} with 3 entries:
"sape" => 4139
"guido" => 4127
"jack" => 4098
```

That's unlike in:

Python 2.7.17 (default, Jul 20 2020, 15:37:01)
and
Python 3.6.9 (default, Jul 17 2020, 12:50:27)

```
>>> tel
{'sape': 4139, 'jack': 4098, 'guido': 4127}
```

Despite Python's docs saying otherwise, on my Ubuntu 18.04.5 LTS.

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

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

調査の方向性

issue に記載された PyDict の動作から始め、指定された Ubuntu 環境で Python 2.7、3.6、3.7 間の順序の違いを再現します。PyCall が辞書の順序を保持すべきか、現在の動作を文書化すべきかを判断します。期待される動作が確立され、関連する実装またはドキュメントに反映されれば完了です。

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

評価

技術スタック
julia, python
領域
tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

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

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