Issue 1323

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jan 8 20:02:13 PST 2011


On 1/8/11 8:07 PM, Robert Clipsham wrote:
> On 08/01/11 23:20, bearophile wrote:
>> Andrei has recently closed issue 1323, it's a small but very useful
>> feature, so I suggest some public discussion:
>> http://d.puremagic.com/issues/show_bug.cgi?id=1323
>>
>> Lines like this is present thousands of time in my Python code:
>> n in [1, 2, 3]
>> c in "hello"
>> "llo" in some_string
>>
>> Bye,
>> bearophile
>
> I'd be all for this, except it's inconsistent.
> ----
> auto arr = [ "foo" : 1, "bar" : 2 ];
> assert("foo" in arr);
> ----
> in for associative arrays works by key, if it works by value for normal
> arrays it's inconsistent, and if it works for keys people will wonder
> why it's not working as expected.

That's what I'm saying, in could work for literal arrays.

Andrei


More information about the Digitalmars-d mailing list