- 27 Eki, 2001 19 kayıt (commit)
-
-
Guido van Rossum yazdı
RISCOS/Makefile: include structseq and weakrefobject; changes to keep command line length below 2048 RISCOS/Modules/riscosmodule.c: typos from the stat structseq patch Include/pyport.h: don't re-#define __attribute__(__x) on RISC OS as it is already defined in c library
-
Tim Peters yazdı
object.h: Added PyType_CheckExact macro. typeobject.c, type_new(): + Use the new macro. + Assert that the arguments have the right types rather than do incomplete runtime checks "sometimes". + If this isn't the 1-argument flavor() of type, and there aren't 3 args total, produce a "types() takes 1 or 3 args" msg before PyArg_ParseTupleAndKeywords produces a "takes exactly 3" msg.
-
Tim Peters yazdı
+ Change keyword arg name from "x" to "items". People passing a mapping object can stretch their imaginations <wink>. + Simplify the docstring text.
-
Tim Peters yazdı
+ Squash another potential buffer overrun. + Simplify the keyword-arg loop by decrementing the count of keywords remaining instead of incrementing Yet Another Variable; also break out early if the number of keyword args remaining hits 0. Since I hit the function's closing curly brace with this patch, that's enough of this for now <wink>.
-
Tim Peters yazdı
we're ensuring that's true during the format parse, get rid of nkwlist.
-
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 21 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.
-