New submission from Ahmed Amr <ahmedam...@gmail.com>:

Hi, I was thinking if we could add equality between array and list to work out 
of the box on the supported datatypes by arrays.

Currently, comparing a list and an array with the same contents returns False.

Also, creating an array of floats from a listA, then turning that array into a 
listB, returns different contents between listA and listB.

It's somehow counter-intuitive for me as even if the underlying implementations 
are different between array and list, they can be viewed as an array data 
structure but with different restrictions/implementations, along with that, 
arrays compare to each other correctly, and lists compare to each other 
correctly.

based on that, switching some lists to arrays in a python codebase may break 
some equality conditions within that code between lists and arrays

----------
files: equality_between_arrays_and_lists.py
messages: 367615
nosy: Ahmed Amr
priority: normal
severity: normal
status: open
title: Equality operations between lists and arrays
type: enhancement
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: 
https://bugs.python.org/file49098/equality_between_arrays_and_lists.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40433>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to