Re: [Python-Dev] Overloading comparison operator for lists

2019-05-28 Thread Montana Burr
Ok, now I'm mildly curious to knpw: What is the justification for causing list == 3 to evaluate to False, besides the obvious "a list cannot equal a number"? On Tue, May 28, 2019 at 9:34 PM Montana Burr wrote: > Ok, now I'm mildly curious to knpw: > > What is the j

[Python-Dev] Overloading comparison operator for lists

2019-05-26 Thread Montana Burr
NumPy arrays have this awesome feature, where array == 3 does an element-wise comparison and returns a list. For example: np.array([1,2,3,4,5])==3 returns [False,False,True,False,False] It would be cool if Python had similar functionality for lists. If that is not possible, perhaps we could co