- 27 Oct, 2001 18 commits
-
-
Tim Peters authored
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 authored
+ Change keyword arg name from "x" to "items". People passing a mapping object can stretch their imaginations <wink>. + Simplify the docstring text.
-
Tim Peters authored
+ 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 authored
we're ensuring that's true during the format parse, get rid of nkwlist.
-
Tim Peters authored
-
Tim Peters authored
the format, instead of waiting until after we can overindex it by mistake.
-
Fred Drake authored
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 authored
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 authored
dict API everywhere on it instead of sometimes using the slower mapping API.
-
Tim Peters authored
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 authored
+ 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 authored
+ 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 authored
+ 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 authored
+ 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 authored
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 authored
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 authored
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 authored
removing useless obfuscation.
-
- 26 Oct, 2001 22 commits
-
-
Tim Peters authored
was intended to verify that sub-sequences of lengths 1 and 3 raise ValueError, but was actually testing string lengths).
-
Andrew M. Kuchling authored
- 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 authored
There's still a lot to do, but it's better now.
-
Andrew M. Kuchling authored
to be covered in an overview article like this.
-
Fred Drake authored
-
Fred Drake authored
-
Fred Drake authored
-
Fred Drake authored
and suggeest that new code that does not require compatibility with older Python versions subclass dictionary, list, or str.
-
Fred Drake authored
happy. (This does not cover everything it complained about, though.)
-
Fred Drake authored
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 authored
-
Fred Drake authored
Minor cleanups & markup consistency fixes.
-
Fred Drake authored
PyObject_CallMethodObArgs().
-
Fred Drake authored
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 authored
-
Guido van Rossum authored
-
Guido van Rossum authored
-
Andrew M. Kuchling authored
-
Fred Drake authored
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 authored
away completely next release, unless someone complains.
-
Fred Drake authored
Reported by Thomas Heller.
-
Steven M. Gava authored
-