Movatterモバイル変換


[0]ホーム

URL:


[Python-Dev] Re: Sets: elt in dict, lst.include

Tim Peterstim.one@home.com
Wed, 31 Jan 2001 16:49:31 -0500


[Tim]>> Seems an unrelated topic:  would "iterators for dictionaries" solve the>> supposed problem with iteration order?[MAL]> No, but it would solve the problem in a more elegant and> generalized way.I'm lost.  "Would [it] solve the ... problem?" "No [it wouldn't solve theproblem], but it would solve the problem ...".  Can only assume we'reswitching topics within single sentences now <wink>.> Besides, it also allows writing code which is thread safe, since> the iterator can take special actions to assure that the dictionary> doesn't change during the iteration phase (see the other thread> about "making mutable objects readonly").Sorry, but immutability has nothing to do with thread safety (the latter hasto do with "doing a right thing" in the presence of multiple threads, tokeep data structures internally consistent; raising an exception is never "aright thing" unless the user is violating the advertised semantics, and ifmutation during iteration is such a violation, the presence or absence ofmultiple threads has nothing to do with that).  IOW, perhaps, a criticalsection is an area of non-exceptional serialization, not a landmine thatmakes other threads *blow up* if they touch it.> ...> I don't remember the figures, but these micor optimizationsThat's plural, but I thought you were talking specifically about the mutablecounter object.  I don't know which, but the two statements don't jibe.> do speedup loops by a noticable amount. Just compare the performance> of stock Python 1.5 against my patched version.No time now, but after 2.1 is out, sure, wrt it (not 1.5).


[8]ページ先頭

©2009-2025 Movatter.jp