- 27 Eki, 2001 14 kayıt (commit)
-
-
Tim Peters yazdı
-
Tim Peters yazdı
the format, instead of waiting until after we can overindex it by mistake.
-
Fred Drake yazdı
the va_list until we are sure we have a format string and need to use it; this avoid premature initialization and having to finalize it several different places because of error returns.
-
Tim Peters yazdı
this routine will report an error now when it didn't before, but, if so, it's a legitimate error that should never have been suppressed.
-
Tim Peters yazdı
dict API everywhere on it instead of sometimes using the slower mapping API.
-
Tim Peters yazdı
The "need" for this was probably removed by an earlier patch that stopped the loop right before it from passing NULL to a dict lookup routine. I still haven't convinced myself that the next loop is correct, so am leaving the next mysterious PyErr_Clear() call in for now.
-
Tim Peters yazdı
+ Generally test nkeywords against 0 instead of keywords against NULL (saves a little work if an empty keywords dict is passed, and is conceptually more on-target regardless). + When a call erroneously specifies a keyword argument both by position and by keyword name: - It was easy to provoke this routine into an internal buffer overrun by using a long argument name. Now uses PyErr_format instead (which computes a safe buffer size). - Improved the error msg.
-
Tim Peters yazdı
+ Got rid of now-redundant dict typecheck. + Renamed nkwds to nkwlist. Now all the "counting" vrbls have names related to the things they're counting in an obvious way.
-
Tim Peters yazdı
+ Renamed argslen to nargs. + Renamed kwlen to nkeywords. This one was especially confusing because kwlen wasn't the length of the kwlist argument, but of the keywords argument.
-
Tim Peters yazdı
+ Removed now-redundant tuple typecheck. + Renamed "tplen" local to "argslen" (it's the length of the "args" argument; I suppose "tp" was for "Tim Peters should rename me someday <wink>).
-
Tim Peters yazdı
introduced this bug just a little while ago, when *adding* internal error checks). vgetargskeywords: Rewrote the section that crawls over the format string. + Added block comment so it won't take the next person 15 minutes to reverse-engineer what it's doing. + Lined up the "else" clauses. + Rearranged the ifs in decreasing order of likelihood (for speed).
-
Tim Peters yazdı
and raise an error if they're insane. vgetargskeywords: the same, except that since this is an internal routine, just assert that the arguments are sane.
-
Tim Peters yazdı
the kwlist vector whenever there was a mix of positional and keyword arguments, and the number of positional arguments exceeded the length of the kwlist vector. If there was just one more positional arg than keyword, the kwlist-terminating NULL got passed to PyMapping_HasKeyString, which set an internal error that vgetargskeywords() then squashed (but it's impossible to say whether it knew it was masking an error). If more than one more positional argument, it went on to pass random trash to PyMapping_HasKeyString, which is why the example at the start happened to kill the process. Pure bugfix candidate.
-
Tim Peters yazdı
removing useless obfuscation.
-
- 26 Eki, 2001 26 kayıt (commit)
-
-
Tim Peters yazdı
was intended to verify that sub-sequences of lengths 1 and 3 raise ValueError, but was actually testing string lengths).
-
Andrew M. Kuchling yazdı
- Describe UnpackTuple() - Credit __unicode__ to MAL Use \pep macro everywhere in body text. (Listening to "The Great Gate of Kiev" -- appropriately triumphal music for this check-in...)
-
Fred Drake yazdı
There's still a lot to do, but it's better now.
-
Andrew M. Kuchling yazdı
to be covered in an overview article like this.
-
Fred Drake yazdı
-
Fred Drake yazdı
-
Fred Drake yazdı
-
Fred Drake yazdı
and suggeest that new code that does not require compatibility with older Python versions subclass dictionary, list, or str.
-
Fred Drake yazdı
happy. (This does not cover everything it complained about, though.)
-
Fred Drake yazdı
and functions: we only need to call PyObject_ClearWeakRefs() if the weakref list is non-NULL. Since these objects are common but weakrefs are still unusual, saving the call at deallocation time makes a lot of sense.
-
Fred Drake yazdı
-
Fred Drake yazdı
Minor cleanups & markup consistency fixes.
-
Fred Drake yazdı
PyObject_CallMethodObArgs().
-
Fred Drake yazdı
PyObject_CallFunctionObArgs() and PyObject_CallMethodObArgs() have the advantage that no format strings need to be parsed. The CallMethod variant also avoids creating a new string object in order to retrieve a method from an object as well.
-
Fred Drake yazdı
-
Guido van Rossum yazdı
-
Guido van Rossum yazdı
-
Andrew M. Kuchling yazdı
-
Fred Drake yazdı
consistent (lack of) vertical space between sections, and remove some of the unnecessary cruft that was added in (finally we get to *remove* something that got generated!).
-
Jack Jansen yazdı
away completely next release, unless someone complains.
-
Fred Drake yazdı
Reported by Thomas Heller.
-
Steven M. Gava yazdı
-
Steven M. Gava yazdı
-
Steven M. Gava yazdı
-
Tim Peters yazdı
outer level, the iterator protocol is used for memory-efficiency (the outer sequence may be very large if fully materialized); at the inner level, PySequence_Fast() is used for time-efficiency (these should always be sequences of length 2). dictobject.c, new functions PyDict_{Merge,Update}FromSeq2. These are wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2- sequences argument instead of a mapping object. For now, I left these functions file static, so no corresponding doc changes. It's tempting to change dict.update() to allow a sequence-of-2-seqs argument too. Also changed the name of dictionary's keyword argument from "mapping" to "x". Got a better name? "mapping_or_sequence_of_pairs" isn't attractive, although more so than "mosop" <wink>. abstract.h, abstract.tex: Added new PySequence_Fast_GET_SIZE function, much faster than going thru the all-purpose PySequence_Size. libfuncs.tex: - Document dictionary(). - Fiddle tuple() and list() to admit that their argument is optional. - The long-winded repetitions of "a sequence, a container that supports iteration, or an iterator object" is getting to be a PITA. Many months ago I suggested factoring this out into "iterable object", where the definition of that could include being explicit about generators too (as is, I'm not sure a reader outside of PythonLabs could guess that "an iterator object" includes a generator call). - Please check my curly braces -- I'm going blind <0.9 wink>. abstract.c, PySequence_Tuple(): When PyObject_GetIter() fails, leave its error msg alone now (the msg it produces has improved since PySequence_Tuple was generalized to accept iterable objects, and PySequence_Tuple was also stomping on the msg in cases it shouldn't have even before PyObject_GetIter grew a better msg).
-
Guido van Rossum yazdı
priority. Add tp_cache; add some comments to others.
-