summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* News about the socket type and the HP-UX port.Guido van Rossum2001-10-271-1/+8
|
* Made SocketType and socket the same thing: a subclassable type whoseGuido van Rossum2001-10-271-119/+167
| | | | | | | | | | | | | | | | | | | | | constructor acts just like socket() before. All three arguments have a sensible default now; socket() is equivalent to socket(AF_INET, SOCK_STREAM). One minor issue: the socket() function and the SocketType had different doc strings; socket.__doc__ gave the signature, SocketType.__doc__ gave the methods. I've merged these for now, but maybe the list of methods is no longer necessary since it can easily be recovered through socket.__dict__.keys(). The problem with keeping it is that the total doc string is a bit long (34 lines -- it scrolls of a standard tty screen). Another general issue with the socket module is that it's a big mess. There's pages and pages of random platform #ifdefs, and the naming conventions are totally wrong: it uses Py prefixes and CapWords for static functions. That's a cleanup for another day... (Also I think the big starting comment that summarizes the API can go -- it's a repeat of the docstring.)
* SF patch #475657 (Dietmar Schwertberger)Guido van Rossum2001-10-273-9/+14
| | | | | | | | | | | | 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
* SF bug #475327: type() produces incorrect error msgTim Peters2001-10-272-6/+22
| | | | | | | | | | | | | 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.
* dictionary() constructor:Tim Peters2001-10-272-11/+9
| | | | | | + Change keyword arg name from "x" to "items". People passing a mapping object can stretch their imaginations <wink>. + Simplify the docstring text.
* vgetargskeywords()Tim Peters2001-10-271-16/+17
| | | | | | | | | | + 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>.
* vgetargskeywords: Now that it's clear that nkwlist must equal max, andTim Peters2001-10-271-4/+3
| | | | we're ensuring that's true during the format parse, get rid of nkwlist.
* vgetargskeywords: Prevent another potential sprintf buffer overrun.Tim Peters2001-10-271-2/+2
|
* vgetargskeywords: Verify kwlist has the required length while parsingTim Peters2001-10-271-20/+24
| | | | | the format, instead of waiting until after we can overindex it by mistake.
* PyObject_CallFunction(), PyObject_CallMethod(): Make sure we do not touchFred Drake2001-10-271-18/+11
| | | | | | 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.
* vgetargskeywords: Removed all PyErr_Clear() calls. It's possible thatTim Peters2001-10-271-4/+8
| | | | | 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.
* vgetargskeywords: The keywords arg is a dict (if non-NULL), so use theTim Peters2001-10-271-5/+5
| | | | | dict API everywhere on it instead of sometimes using the slower mapping API.
* vgetargskeywords: Removed one of the mysterious PyErr_Clear() calls.Tim Peters2001-10-271-10/+1
| | | | | | | 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.
* vgetargskeywords:Tim Peters2001-10-271-16/+9
| | | | | | | | | | | | + 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.
* vgetargskeywords:Tim Peters2001-10-271-20/+7
| | | | | | + 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.
* vgetargskeywords:Tim Peters2001-10-271-12/+13
| | | | | | | + 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.
* vgetargskeywords:Tim Peters2001-10-271-15/+10
| | | | | | | + 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>).
* PyArg_ParseTupleAndKeywords: return false on internal error, not -1 (ITim Peters2001-10-271-30/+34
| | | | | | | | | | | 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).
* PyArg_ParseTupleAndKeywords: do basic sanity checks on the arguments,Tim Peters2001-10-271-1/+16
| | | | | | 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.
* tuple(3,4,5,x=2) dumped core on my box. vgetargskeywords() overindexedTim Peters2001-10-271-3/+13
| | | | | | | | | | | | | | 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.
* vgetargskeywords(): remove test that can't succeed. Not a bugfix, justTim Peters2001-10-271-13/+7
| | | | removing useless obfuscation.
* dict_constructor(): The last test was passing for the wrong reason (itTim Peters2001-10-261-1/+1
| | | | | was intended to verify that sub-sequences of lengths 1 and 3 raise ValueError, but was actually testing string lengths).
* Fill in remaining XXX spotsAndrew M. Kuchling2001-10-261-19/+31
| | | | | | | | - 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...)
* Fix up a number of small problems with the DOM documentation.Fred Drake2001-10-262-20/+35
| | | | There's still a lot to do, but it's better now.
* Finish off the type/class section; I don't think there's much elseAndrew M. Kuchling2001-10-261-73/+125
| | | | to be covered in an overview article like this.
* Remove unused variable.Fred Drake2001-10-261-1/+0
|
* Now that Misc/Makefile.pre.in is gone, do not attempt to install it.Fred Drake2001-10-261-1/+0
|
* Explain what [].insert() does when the target index is negative.Fred Drake2001-10-261-7/+11
|
* Add notes pointing out that these classes are kept for backward compatibilityFred Drake2001-10-261-0/+17
| | | | | and suggeest that new code that does not require compatibility with older Python versions subclass dictionary, list, or str.
* Re-arrange things and remove some unused variables/imports to keep pycheckerFred Drake2001-10-262-4/+14
| | | | happy. (This does not cover everything it complained about, though.)
* Be smarter about clearing the weakref lists for instances, instance methods,Fred Drake2001-10-262-3/+6
| | | | | | 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.
* Many, many small fixes and improvements, most suggested by Detlef Lannert.Fred Drake2001-10-261-17/+27
|
* Added docs for PyObject_CallFunctionObArgs() and PyObject_CallMethodObArgs().Fred Drake2001-10-261-11/+32
| | | | Minor cleanups & markup consistency fixes.
* Added refcount data for PyObject_CallFunctionObArgs() andFred Drake2001-10-261-0/+9
| | | | PyObject_CallMethodObArgs().
* Added two new functions to conveniently call functions/methods from C.Fred Drake2001-10-262-5/+99
| | | | | | | 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.
* Some style changes and typo fixes.Fred Drake2001-10-261-6/+9
|
* Updated this README to reality.Guido van Rossum2001-10-261-15/+6
|
* Some news.Guido van Rossum2001-10-261-1/+13
|
* Delete Makefile.pre.in (BDFL pronouncement)Andrew M. Kuchling2001-10-261-305/+0
|
* Clean up the tables of child links generated by stock LaTeX2HTML so we getFred Drake2001-10-261-0/+8
| | | | | | 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!).
* Moved PythonScript to unsupported at Bill Bedford's request. It'll goJack Jansen2001-10-269-0/+0
| | | | away completely next release, unless someone complains.
* Typo: destuction --> destructionFred Drake2001-10-261-1/+1
| | | | Reported by Thomas Heller.
* further work supporting reading config dialog values form config files.Steven M. Gava2001-10-261-20/+40
|
* dynamic option menu widget.Steven M. Gava2001-10-261-0/+34
|
* further work on loading config dialog values from the config filesSteven M. Gava2001-10-261-61/+15
|
* Generalize dictionary() to accept a sequence of 2-sequences. At theTim Peters2001-10-267-36/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* Update. __dict__ assignment done. Reorder remaining "to do" items byGuido van Rossum2001-10-261-7/+22
| | | | priority. Add tp_cache; add some comments to others.
* Allow assignment to newinstance.__dict__.Guido van Rossum2001-10-262-1/+50
|
* Fix two typos, one noted by Noah Spurrier in SF bug #475166, theGuido van Rossum2001-10-262-2/+3
| | | | | second noted after a second's thought about what the next line should do. :-(
* Add sendall() method, which loops until all data is written or anGuido van Rossum2001-10-261-2/+44
| | | | | | | error occurs, and doesn't return a count. (This is my second patch from SF patch #474307, with small change to the docstring for send().) 2.1.2 "bugfix" candidate.