On Aug 26, 10:49 am, ++imanshu [EMAIL PROTECTED] wrote:
Hi,
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries.
NO!
When you iterate over a list (or even a array) it is the members of
the list in the order they appear that is of interest. When
Marc 'BlackJack' Rintsch wrote:
On Mon, 25 Aug 2008 19:57:06 -0700, alex23 wrote:
On Aug 26, 10:49 am, ++imanshu [EMAIL PROTECTED] wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for
both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python
++imanshu wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
It's because dealing with keys makes far more sense, since that's how
the dictionary data
On Aug 26, 11:52 am, Erik Max Francis [EMAIL PROTECTED] wrote:
++imanshu wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
It's because dealing with
++imanshu:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
D language works like you say, and it's awful. With a key you can find
its value, but given only the
On Aug 26, 4:04 pm, ++imanshu [EMAIL PROTECTED] wrote:
On Aug 26, 11:52 am, Erik Max Francis [EMAIL PROTECTED] wrote:
++imanshu wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python
Lie wrote:
Anyway, there is two obvious choice when dealing with dictionary
looping: return the keys and return the key and value.
The python designer thought...
The issue of whether there should be a default iterator and if so, which
of the two obvious choices should be picked, was
Hi,
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
Thanks,
++imanshu
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 26, 10:49 am, ++imanshu [EMAIL PROTECTED] wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
By 'arrays' do you mean lists? tuples?
I'm not sure how
On Aug 26, 12:57 pm, alex23 [EMAIL PROTECTED] wrote:
By 'arrays' do you mean lists? tuples?
My apologies, there actually -is- an array type in Python.
I've just honestly never had any cause to use it :)
I'm still not entirely sure what you would like 'in' to do, though.
--
On Aug 25, 9:57 pm, alex23 [EMAIL PROTECTED] wrote:
On Aug 26, 10:49 am, ++imanshu [EMAIL PROTECTED] wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
On Mon, 25 Aug 2008 19:57:06 -0700, alex23 wrote:
On Aug 26, 10:49 am, ++imanshu [EMAIL PROTECTED] wrote:
Wouldn't it be nicer to have 'in' return values (or keys) for
both
arrays and dictionaries. Arrays and Dictionaries looked so similar in
Python until I learned this difference.
On Aug 26, 2:30 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
The OP isn't talking about the ``in`` operator but ``in`` as part of
``for … in …``. So it's actually the question why ``list(a_dict)``
doesn't return a list of values but a list of keys.
Aaaah! Cheers, Marc, that didn't
13 matches
Mail list logo