PyDict now a possible bug, on current Python in Ubuntu and Python 3.7 according to docs
- Langage dominant
- Julia
- Étoiles
- 1.5k
- Forks
- 186
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par le comportement de PyDict décrit dans l’issue et reproduisez la différence d’ordre entre Python 2.7, 3.6 et 3.7 dans l’environnement Ubuntu indiqué. Déterminez si PyCall doit préserver l’ordre des dictionnaires ou documenter le comportement actuel ; le travail est terminé lorsque le comportement attendu est établi et pris en compte dans l’implémentation ou la documentation pertinente.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- julia, python
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 30/100