- 05 May, 2001 11 kayıt (commit)
-
-
Tim Peters yazdı
-
Tim Peters yazdı
safely together and don't duplicate logic (the common logic was factored out into new private API function _PySequence_IterContains()). Visible change: some_complex_number in some_instance no longer blows up if some_instance has __getitem__ but neither __contains__ nor __iter__. test_iter changed to ensure that remains true.
-
Andrew M. Kuchling yazdı
but don't plan on actually writing any text until, ooh, say, July or thereabouts.
-
Tim Peters yazdı
-
Tim Peters yazdı
-
Tim Peters yazdı
NEEDS DOC CHANGES A few more AttributeErrors turned into TypeErrors, but in test_contains this time. The full story for instance objects is pretty much unexplainable, because instance_contains() tries its own flavor of iteration-based containment testing first, and PySequence_Contains doesn't get a chance at it unless instance_contains() blows up. A consequence is that some_complex_number in some_instance dies with a TypeError unless some_instance.__class__ defines __iter__ but does not define __getitem__.
-
Tim Peters yazdı
to string.join(), so that when the latter figures out in midstream that it really needs unicode.join() instead, unicode.join() can actually get all the sequence elements (i.e., there's no guarantee that the sequence passed to string.join() can be iterated over *again* by unicode.join(), so string.join() must not pass on the original sequence object anymore).
-
Tim Peters yazdı
because PySequence_Fast() started working for free as soon as PySequence_Tuple() learned how to work with iterators. For some reason unicode.join() still doesn't work, though.
-
Tim Peters yazdı
several of these turned up and got fixed during the iteration crusade.
-
Tim Peters yazdı
NEEDS DOC CHANGES. This one surprised me! While I expected tuple() to be a no-brainer, turns out it's actually dripping with consequences: 1. It will *allow* the popular PySequence_Fast() to work with any iterable object (code for that not yet checked in, but should be trivial). 2. It caused two std tests to fail. This because some places used PyTuple_Sequence() (the C spelling of tuple()) as an indirect way to test whether something *is* a sequence. But tuple() code only looked for the existence of sq->item to determine that, and e.g. an instance passed that test whether or not it supported the other operations tuple() needed (e.g., __len__). So some things the tests *expected* to fail with an AttributeError now fail with a TypeError instead. This looks like an improvement to me; e.g., test_coercion used to produce 559 TypeErrors and 2 AttributeErrors, and now they're all TypeErrors. The error details are more informative too, because the places calling this were *looking* for TypeErrors in order to replace the generic tuple() "not a sequence" msg with their own more specific text, and AttributeErrors snuck by that.
-
Tim Peters yazdı
internals) so clients can be a lot dumber (wrt their knowledge).
-
- 04 May, 2001 4 kayıt (commit)
-
-
Guido van Rossum yazdı
-
Guido van Rossum yazdı
-
Tim Peters yazdı
free to do one!
-
Tim Peters yazdı
NEEDS DOC CHANGES.
-
- 03 May, 2001 13 kayıt (commit)
-
-
Tim Peters yazdı
-
Tim Peters yazdı
NEEDS DOC CHANGES. Possibly contentious: The first time s.next() yields StopIteration (for a given map argument s) is the last time map() *tries* s.next(). That is, if other sequence args are longer, s will never again contribute anything but None values to the result, even if trying s.next() again could yield another result. This is the same behavior map() used to have wrt IndexError, so it's the only way to be wholly backward-compatible. I'm not a fan of letting StopIteration mean "try again later" anyway.
-
Fred Drake yazdı
at the same time as it did from PyObject_Init() .
-
Fred Drake yazdı
the code necessary to accomplish this is simpler and faster if confined to the object implementations, so we only do this there. This causes no behaviorial changes beyond a (very slight) speedup.
-
Fred Drake yazdı
void function.
-
Fred Drake yazdı
need to be specified in the type structures independently. The flag exists only for binary compatibility. This is a "source cleanliness" issue and introduces no behavioral changes.
-
Tim Peters yazdı
-
Tim Peters yazdı
NEEDS DOC CHANGES.
-
Fred Drake yazdı
When replacing the exception object, be sure we stuff the new value in sys.last_value (which we already did for the original value).
-
Fred Drake yazdı
-
Fred Drake yazdı
-
Fred Drake yazdı
annotations! Also fixed a typo noted by Neil S.
-
Fred Drake yazdı
-
- 02 May, 2001 12 kayıt (commit)
-
-
Fred Drake yazdı
-
Fred Drake yazdı
appropriate next() method, and this is what people really want to do with these objects in practice.
-
Fred Drake yazdı
the support for containers and iteration.
-
Fred Drake yazdı
-
Marc-André Lemburg yazdı
objects but instead assume that they use the requested encoding. This is needed on Windows to enable opening files by passing in Unicode file names.
-
Guido van Rossum yazdı
dictionary size was comparing ma_size, the hash table size, which is always a power of two, rather than ma_used, wich changes on each insertion or deletion. Fixed this.
-
Marc-André Lemburg yazdı
-
Tim Peters yazdı
filter() to no longer insist that len(seq) be defined. NEEDS DOC CHANGES.
-
Tim Peters yazdı
-
Tim Peters yazdı
-
Fred Drake yazdı
Refactored some object initialization to be more reusable.
-
Fred Drake yazdı
-