summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make __class__ assignment possible, when the object structures are theGuido van Rossum2001-09-252-4/+111
| | | | | | | | | | | | | | same. I hope the test for structural equivalence is stringent enough. It only allows the assignment if the old and new types: - have the same basic size - have the same item size - have the same dict offset - have the same weaklist offset - have the same GC flag bit - have a common base that is the same except for maybe the dict and weaklist (which may have been added separately at the same offsets in both types)
* + Got rid of all instances of <small>. Under IE5, GUI-mode pydoc hasTim Peters2001-09-251-22/+19
| | | | | | | | | | | | | always been close to useless, because the <small>-ified docstrings were too small to read, even after cranking up my default font size just for pydoc. Now it reads fine under my defaults (as does most of the web <0.5 wink>). If it's thought important to play tricks with font size, tough, then someone should rework pydoc to use style sheets, and (more) predictable percentage-of-default size controls. + Tried to ensure that all <dt> and <dd> tags are closed. I've read (but don't know) that some browsers get confused if they're not, and esp. when style sheets are in use too.
* GUI mode now displays useful stuff for properties. This is usually betterTim Peters2001-09-251-4/+14
| | | | | than text mode, since here we can hyperlink from the getter etc methods back to their definitions.
* + Text-mode (but not yet GUI mode) pydoc now produces useful stuff forTim Peters2001-09-241-9/+35
| | | | | | | | | | properties: the docstring (if any) is displayed, and the getter, setter and deleter (if any) functions are named. All that is shown indented after the property name. + Text-mode pydoc class display now draws a horizontal line between class attribute groups (similar to GUI mode -- while visually more intrusive in text mode, it's still an improvement).
* Make properties discoverable from Python:Tim Peters2001-09-243-27/+90
| | | | | | | | | | | | | - property() now takes 4 keyword arguments: fget, fset, fdel, doc. Note that the real purpose of the 'f' prefix is to make fdel fit in ('del' is a keyword, so can't used as a keyword argument name). - These map to visible readonly attributes 'fget', 'fset', 'fdel', and '__doc__' in the property object. - fget/fset/fdel weren't discoverable from Python before. - __doc__ is new, and allows to associate a docstring with a property.
* Added several new tests to check the behavior with respect to doctypeFred Drake2001-09-241-6/+77
| | | | | | | declarations and weird markup that we used to accept & ignore that recent versions raised an exception for; the original behavior has been restored and augmented (the user can decide what to do if they care; the default is to ignore it as done in early versions).
* Adapt to use the test_main() approach.Fred Drake2001-09-241-1/+6
|
* Re-factor the SGMLParser class to use the new markupbase.ParserBase class.Fred Drake2001-09-241-75/+34
| | | | | | | | | | Use a new internal method, error(), consistently to raise parse errors; the new base class also uses this. Adjust the parse_comment() method to return the new offset into the buffer instead of the number of characters scanned; this was the only helper method that did it this way, so we have better consistency now. Required to share the new base class. This fixes SF bug #448482 and #453706.
* Re-factor the HTMLParser class to use the new markupbase.ParserBase class.Fred Drake2001-09-241-305/+19
| | | | | Use a new internal method, error(), consistently to raise parse errors; the new base class also uses this.
* Be consistent about the string module.Fred Drake2001-09-241-1/+1
|
* New base class for the SGMLParser and HTMLParser classes from the sgmllibFred Drake2001-09-241-0/+306
| | | | | | | | | | and HTMLParser modules (and indirectly for the htmllib.HTMLParser class). This has all the support for scanning over DOCTYPE declarations; it warrants having a base class since this is a fair amount of tedious code (since it's fairly strict), and should be in a separate module to avoid compiling many REs that are not used (which would happen if this were placed in either then sgmllib or HTMLParser module).
* Don't swap the arguments to PyFrame_BlockSetup when recreating the recentlyThomas Wouters2001-09-241-2/+2
| | | | | | | | | popped frame-block. What an embarrassing bug! Especially for Jeremy, since he accepted the patch :-) This fixes SF bugs #463359 and #462937, and possibly other, *very* obscure bugs with very deeply nested loops that continue the loop and then break out of it or raise an exception.
* Another comparison patch-up: comparing a type with a dynamic metatypeGuido van Rossum2001-09-242-1/+9
| | | | to one with a static metatype raised an obscure error.
* Add more tests showing the relationship between exceptions raised & caughtFred Drake2001-09-241-9/+64
| | | | and the information provided to the profiler. This stuff is a mess!
* Do the same thing to complex that I did to str: the rich comparisonGuido van Rossum2001-09-242-7/+25
| | | | | function returns NotImplemented when comparing objects whose tp_richcompare slot is not itself.
* StringIO patch #462596: let's [c]StringIO accept read buffers onMarc-André Lemburg2001-09-243-18/+32
| | | | input to .write() too.
* Fixed old bug (caused by careless Carbonizing) that noone noticed untilJust van Rossum2001-09-241-1/+1
| | | | this week (apparently me and Bob Heeter at more or less the same time).
* Patch #463421: speed up md5 module with real memcpy/set.Martin v. Löwis2001-09-241-28/+4
|
* Change string comparison so that it applies even when one (or both)Guido van Rossum2001-09-242-9/+10
| | | | | arguments are subclasses of str, as long as they don't override rich comparison.
* 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.