JuliaPy / JuliaPy/PyCall.jl

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

Aperta
#849 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Julia
Stelle
1.5k
Fork
186
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start at the PyDict behavior described in the issue and reproduce the ordering difference across Python 2.7, 3.6, and 3.7 on the stated Ubuntu environment. Determine whether PyCall should preserve dictionary order or document current behavior; done means the expected behavior is established and reflected in the relevant implementation or documentation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
julia, python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.