PyDict now a possible bug, on current Python in Ubuntu and Python 3.7 according to docs
- Lenguaje dominante
- Julia
- Estrellas
- 1.5k
- Forks
- 186
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con el comportamiento de PyDict descrito en el issue y reproduce la diferencia de orden entre Python 2.7, 3.6 y 3.7 en el entorno de Ubuntu indicado. Determina si PyCall debe preservar el orden de los diccionarios o documentar el comportamiento actual; se considera terminado cuando el comportamiento esperado está establecido y reflejado en la implementación o documentación pertinente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- julia, python
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 30/100