summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix the baffler that Tim reported: sometimes the repr() of an objectGuido van Rossum2001-09-242-4/+4
| | | | | looks like <X object at ...>, sometimes it says <X instance at ...>. Make this uniformly say <X object at ...>.
* Add more signature information and some descriptions for the new APIsFred Drake2001-09-241-1/+89
| | | | | | | introduced in Python 2.2. Add documentation for the slice object interface (not complete). Added version annotations for several of the Python 2.2 APIs already documented.
* Add more reference count information.Fred Drake2001-09-241-0/+28
|
* Add link to Unix Review's 2.2 articleAndrew M. Kuchling2001-09-241-2/+11
| | | | Fix two errors
* start of new config handling stuffSteven M. Gava2001-09-246-48/+468
|
* More work on class display:Tim Peters2001-09-241-43/+61
| | | | | | | | | + Minor code cleanup, generalization and simplification. + "Do something" to make the attribute aggregation more apparent: - In text mode, stick a "* " at the front of subgroup header lines. - In GUI mode, display a horizontal rule between subgroups. For GUI mode, this is a huge improvement, at least under IE.
* Try to do for pydoc's GUI mode what the earlier checkin did for textTim Peters2001-09-241-9/+92
| | | | | | | | | | | | | | | | | | | | mode (identify the source class for class attrs; segregate attrs according to source class, and whether class method, static method, property, plain method, or data; display data attrs; display docstrings for data attrs when possible). Alas, this is mondo ugly, and I'm no HTML guy. Part of the problem is that pydoc's GUI mode has always been ugly under IE, largely because <small> under IE renders docstrings unreadably small (while sometimes non-docstring text is painfully large). Another part is that these segregated listings of attrs would *probably* look much better as bulleted lists. Alas, when I tried that, the bullets all ended up on lines by themselves, before the method names; this is apparently because pydoc (ab?)uses definition lists for format effects, and at least under IE if a definition list is the first chunk of a list item, it gets rendered on a line after the <li> bullet. An HTML wizard would certainly be welcomed here.
* Added a note about the new email package.Barry Warsaw2001-09-241-0/+4
|
* Part of a partial solution to SF bugs 463378, 463381, 463383, 463384.Tim Peters2001-09-231-8/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This almost entirely replaces how pydoc pumps out class docs, but only in text mode (like help(whatever) from a Python shell), not in GUI mode. A class C's attrs are now grouped by the class in which they're defined, attrs defined by C first, then inherited attrs grouped by alphabetic order of the defining classes' names. Within each of those groups, the attrs are subgrouped according to whether they're plain methods, class methods, static methods, properties, or data. Note that pydoc never dumped class data attrs before. If a class data attr is implemented via a data descriptor, the data docstring (if any) is also displayed (e.g., file.softspace). Within a subgroup, the attrs are listed alphabetically. This is a friggin' mess, and there are bound to be glitches. Please beat on it and complain! Here are three glitches: 1. __new__ gets classifed as 'data', for some reason. This will have to get fixed in inspect.py, but since the latter is already looking for any clue that something is a method, pydoc will almost certainly not know what to do with it when its classification changes. 2. properties are special-cased to death. Unlike any other kind of function or method, they don't have a __name__ attr, so none of pydoc's usual code can deal with them. Worse, the getter and setter and del'er methods associated with a property don't appear to be discoverable from Python, so there's really nothing I can think of to do here beyond just listing their names. Note that a property can't be given a docstring, either (or at least I've been unable to sneak one in) -- perhaps the property() constructor could take an optional doc argument? 3. In a nested-scopes world, pydoc still doesn't know anything about nesting, so e.g. classes nested in functions are effectively invisible.
* Reactivate participation of expat parsers in GC. Fixes bug #462710.Martin v. Löwis2001-09-231-2/+33
|
* Install the new Lib/email pkg.Tim Peters2001-09-231-0/+16
| | | | Create & populate the new Lib/test/data directory.
* Generalize file.writelines() to allow iterable objects.Tim Peters2001-09-235-35/+91
|
* The test data (mostly example messages) for the email package testBarry Warsaw2001-09-2316-0/+643
| | | | suite. Note that other tests can put input data in this directory.
* An extensive test suite for the email package.Barry Warsaw2001-09-231-0/+797
|
* The email package version 1.0, prototyped as mimelibBarry Warsaw2001-09-2312-0/+1302
| | | | | | <http://sf.net/projects/mimelib>. There /are/ API differences between mimelib and email, but most of the implementations are shared (except where cool Py2.2 stuff like generators are used).
* Added API information for the PyCallIter_*() and PySeqIter_*() functions.Fred Drake2001-09-232-1/+66
| | | | Added signatures for some new PyType_*() functions.
* New function classify_class_attrs(). As a number of SF bug reportsTim Peters2001-09-232-0/+286
| | | | | | | | | | | | | | | | | | | point out, pydoc doesn't tell you where class attributes were defined, gets several new 2.2 features wrong, and isn't aware of some new features checked in on Thursday <wink>. pydoc is hampered in part because inspect.py has the same limitations. Alas, I can't think of a way to fix this within the current architecture of inspect/pydoc: it's simply not possible in 2.2 to figure out everything needed just from examining the object you get back from class.attr. You also need the class context, and the method resolution order, and tests against various things that simply didn't exist before. OTOH, knowledge of how to do that is getting quite complex, so doesn't belong in pydoc. classify_class_attrs takes a different approach, analyzing all the class attrs "at once", and returning the most interesting stuff for each, all in one gulp. pydoc needs to be reworked to use this for classes (instead of the current "filter dir(class) umpteen times against assorted predicates" approach).
* Fix restore (difflib.restore() became a generator too).Tim Peters2001-09-221-1/+2
|
* Make difflib.ndiff() and difflib.Differ.compare() generators. ThisTim Peters2001-09-224-70/+84
| | | | | restores the 2.1 ability of Tools/scripts/ndiff.py to start producing output before the entire comparison is complete.
* Add note about __getattribute__.Guido van Rossum2001-09-221-0/+9
|
* Add a function to compute a class's method resolution order. This isTim Peters2001-09-223-1/+47
| | | | | | easy for 2.2 new-style classes, but trickier for classic classes, and different approaches are needed "depending". The function will allow later code to treat all flavors of classes uniformly.
* Since the most likely failure mode for an expected-output test is a changeTim Peters2001-09-221-15/+22
| | | | | | | somewhere inside a line, use ndiff so that intraline difference marking can point out what changed within a line. I don't remember diff-style abbreviations either (haven't used it since '94, except to produce patches), so say the rest in English too.
* {String,cString}IO.StringIO's support iteration.Barry Warsaw2001-09-221-0/+4
|
* I_getiter(): Function for the tp_iter slot of Itype so thatBarry Warsaw2001-09-221-20/+45
| | | | | | cStringIO's can participate in the iterator protocol. Fill the Itype.tp_iter slot with I_getiter()
* __iter__(): New method so that StringIO's can participate in theBarry Warsaw2001-09-221-0/+3
| | | | iterator protocol.
* Note that files are iterable; describe what the iterator returns.Fred Drake2001-09-221-0/+5
| | | | This closes SF bug #463738.
* Converted test_StringIO.py to use unittest, soBarry Warsaw2001-09-222-62/+71
| | | | | | | Lib/test/output/test_StringIO is no longer necessary. Also, added a test of the iterator protocol that's just been added to StringIO's and cStringIO's.
* Start of a test to make sure the profiler/tracer support in the coreFred Drake2001-09-221-0/+110
| | | | interpreter is reporting what we expect to see.
* Add the __getattr__ hook back. The rules are now:Guido van Rossum2001-09-212-5/+43
| | | | | | | - if __getattribute__ exists, it is called first; if it doesn't exists, PyObject_GenericGetAttr is called first. - if the above raises AttributeError, and __getattr__ exists, it is called.
* Bump version number.Fred Drake2001-09-212-2/+2
|
* Added reference to Tutorial section on user-defined exceptions forFred Drake2001-09-211-9/+15
| | | | | information on defining new exceptions. This closes SF bug #443559.
* Exceptions in interactive examlpes did not always include the indication ofFred Drake2001-09-211-19/+85
| | | | | | | | | the source file using "in ?". Added a description of the bare "raise" statement. Added more description and examples for user-defined exceptions; this is part of a response to SF bug #443559.
* reportdiff(): print a "plain diff" style diff.Guido van Rossum2001-09-211-4/+30
| | | | XXX This should really be a unified diff, but I can't be bothered.
* Oops. I didn't expect that some tests (test_cookie) have expectedGuido van Rossum2001-09-212-9/+3
| | | | | output *and* doctest stuff. Assuming the doctest stuff comes after the expected output, this fixes that.
* Change the way unexpected output is reported: rather than stopping atGuido van Rossum2001-09-212-94/+52
| | | | | | | | | | the first difference, let the test run till completion, then gather all the output and compare it to the expected output using difflib. XXX Still to do: produce diff output that only shows the sections that differ; currently it produces ndiff-style output because that's the easiest to produce with difflib, but this becomes a liability when the output is voluminous and there are only a few differences.
* Change the name of the __getattr__ special method for new-styleGuido van Rossum2001-09-213-11/+11
| | | | | | | | classes to __getattribute__, to make it crystal-clear that it doesn't have the same semantics as overriding __getattr__ on classic classes. This is a halfway checkin -- I'll proceed to add a __getattr__ hook that works the way it works in classic classes.
* Make these modules work when Python is compiled without Unicode support.Guido van Rossum2001-09-213-5/+18
|
* Add tests for repr() of strings containing string quotes as well.Guido van Rossum2001-09-211-0/+4
|
* Fix a bug in rendering of \\ by repr() -- it rendered as \\\ insteadGuido van Rossum2001-09-211-0/+1
| | | | of \\.
* Test basic functioning of unicode repr(). (If this breaks Jython,Guido van Rossum2001-09-211-0/+11
| | | | please let me know and we'll figure out how to fix the test.)
* Add a small test to verify that member and getset descriptors now haveGuido van Rossum2001-09-201-0/+8
| | | | docstrings (using file.closed and file.name as examples).
* Add optional docstrings to getset descriptors. Fortunately, there'sGuido van Rossum2001-09-2010-26/+43
| | | | | | | | | | no backwards compatibility to worry about, so I just pushed the 'closure' struct member to the back -- it's never used in the current code base (I may eliminate it, but that's more work because the getter and setter signatures would have to change.) As examples, I added actual docstrings to the getset attributes of a few types: file.closed, xxsubtype.spamdict.state.
* Change testdescr.py to use the test_main() approach.Guido van Rossum2001-09-201-4/+4
|
* Change the PyUnit-based tests to use the test_main() approach. ThisFred Drake2001-09-2034-39/+229
| | | | | allows using the tests with unittest.py as a script. The tests will still run when run as a script themselves.
* Add optional docstrings to member descriptors. For backwardsGuido van Rossum2001-09-2017-251/+313
| | | | | | | | | | | | | | | compatibility, this required all places where an array of "struct memberlist" structures was declared that is referenced from a type's tp_members slot to change the type of the structure to PyMemberDef; "struct memberlist" is now only used by old code that still calls PyMember_Get/Set. The code in PyObject_GenericGetAttr/SetAttr now calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef argument. As examples, I added actual docstrings to the attributes of a few types: file, complex, instance method, super, and xxsubtype.spamlist. Also converted the symtable to new style getattr.
* Fill in a few more descriptions for xml.parsers.expat.Fred Drake2001-09-201-5/+24
|
* Document new file() constructor, with the body of open()'s text, plus aTim Peters2001-09-201-37/+45
| | | | | "new in 2.2" blurb at the end. Replace open()'s text by pointing back to file().
* Document all the Py*_CheckExact() functions.Fred Drake2001-09-202-26/+174
| | | | Document many more of the PyLong_{As,From}*() functions.
* PyLocale_setlocale(): silence compiler warning about free() of a constGuido van Rossum2001-09-201-1/+1
| | | | char *.
* Fix Unicode .join() method to raise a TypeError for sequenceMarc-André Lemburg2001-09-202-2/+11
| | | | | | | | | | elements which are not Unicode objects or strings. (This matches the string.join() behaviour.) Fix a memory leak in the .join() method which occurs in case the Unicode resize fails. Restore the test_unicode output.