Movatterモバイル変換
[0]ホーム
[Python-Dev] Re: Sets: elt in dict, lst.include
Thomas Woutersthomas@xs4all.net
Mon, 29 Jan 2001 15:58:16 +0100
On Mon, Jan 29, 2001 at 09:48:22AM -0500, Guido van Rossum wrote:> How about:> for key in dict: ...# ... over keys> for key:value in dict: ...# ... over items> This is syntactically unambiguous (a colon is currently illegal in> that position).I won't comment on the syntax right now, I need to look at it for a whilefirst :-) However, what about MAL's point about dict ordering, internally ?Wouldn't FOR_LOOP be forced to generate a list of keys anyway, to avoidskipping keys ? I know currently the dict implementation doesn't do anyreordering except during adds/deletes, but there is nothing in the languageref that supports that -- it's an implementation detail. Would we make afuture enhancement where (some form of) gc would 'clean up' largedictionaries impossible ?-- Thomas Wouters <thomas@xs4all.net>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
[8]ページ先頭