Commit Graph

58 Commits

Author SHA1 Message Date
Barry Warsaw 00decd7835 Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py.  Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.

This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType.  Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor().  The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.

The patch also includes documentation and test suite updates.

I commit these changes now under these guiding principles:

1. Silence is assent.  The release manager has not said "no", and of the few
   people that cared enough to respond to the thread, the worst vote was "0".

2. It's easier to ask for forgiveness than permission.

3. It's so dang easy to revert stuff in svn, that you could view this as a
   forcing function. :)

Windows build patches will follow.
2006-07-27 23:43:15 +00:00
Andrew M. Kuchling 509a41da9c Typo fix 2005-12-22 19:31:21 +00:00
Neal Norwitz 3cb68a2512 Remove extra 'types'
Change a couple of list -> mylist
2003-01-10 13:52:30 +00:00
Raymond Hettinger 6fe1299b09 SF bug #652888: bad documentation for the "type" builtin
Clarified that not all types are included.  The OP was looking for a
StaticMethodType.

Also, added a note and example suggesting the use of int,str, etc.
instead of IntType, StrType, etc.

Renamed the crummy variable name in the example from "list" to "mylist".
2003-01-10 09:33:08 +00:00
Fred Drake c58507582b Added a version annotation for StringTypes.
Added documentation for BooleanType.
2002-05-22 02:44:24 +00:00
Fred Drake 5ecb7aaa6a Add availability information for a couple of the types, and notes on writing
string-type tests for versions of Python built without Unicode support.
2002-05-21 14:28:22 +00:00
Skip Montanaro a1c3662e84 forgot to mark use of StringType and UnicodeType in the text. 2001-09-29 13:53:21 +00:00
Skip Montanaro c7ba0c4c24 added description of StringTypes object 2001-09-29 13:49:41 +00:00
Tim Peters 3e7b1a04a0 Teach the types module about generators. Thanks to James Althoff on the
Iterators list for bringing it up!
2001-06-25 19:46:25 +00:00
Fred Drake 0b72116812 Marc-Andre Lemburg <mal@lemburg.com>:
Added UnicodeType.
2000-04-06 15:05:04 +00:00
Fred Drake 38e5d27cae Merged changes from the 1.5.2p2 release.
(Very rough.)
2000-04-03 20:13:55 +00:00
Fred Drake 295da24eaf New section header style.
Fix up a few synopses.
1998-08-10 19:42:37 +00:00
Guido van Rossum 1eb200d360 Added 3 missing types: ComplexType, SliceType, EllipsisType. 1998-07-24 15:01:05 +00:00
Fred Drake 78a6ddbdd1 Move files around in a different way, so CVS picks up all the changes. ;-) 1998-07-24 14:27:22 +00:00
Guido van Rossum 472b9a3f06 Clearly I was to quick with the previous commit...
Need to add \optional{} to sort argument too.

Made x a \var in descr of pop.

Fixed note for pop() and mentioned that it is experimental.

Also added pop to index.
1998-06-30 16:02:35 +00:00
Guido van Rossum 97ea116472 Documented the pop() method for lists.
# The brackets generated by \optional{} are real ugly.  Alas...
1998-06-30 15:56:23 +00:00
Fred Drake e5836d9811 Mark the 'whence' parameter of the file object's seek() method as optional;
it's already decribed that way in the description.
1998-06-25 16:26:56 +00:00
Fred Drake ee60191d1d Lighten up tables. 1998-04-11 20:53:03 +00:00
Fred Drake 8e729ec31a Caught a few more spurious \setindexsubitem macros.... 1998-04-07 22:06:41 +00:00
Fred Drake 8efde2197b Several minor markup nits. 1998-04-03 07:13:56 +00:00
Fred Drake 8fe533e6a0 Use the new {methoddesc} and {memberdesc} environments as appropriate. 1998-03-27 05:27:08 +00:00
Fred Drake cce1090d49 Change "\," to just "," in function signatures. This is easier to maintain,
works better with LaTeX2HTML, and allows some simplification of the python.sty
macros.
1998-03-17 06:33:25 +00:00
Fred Drake 1a855fad30 Markup nits.
Adjusted some index entries.
1998-03-16 05:23:50 +00:00
Fred Drake 8aee0e0356 Add some more labels for logical addressing. 1998-03-10 05:21:39 +00:00
Fred Drake c3e4549012 Added \label{} for logical addressing. 1998-02-19 20:22:13 +00:00
Fred Drake 31ecd50d02 Added \label{} for logical addressing. 1998-02-18 15:40:11 +00:00
Fred Drake 7154d382c3 Update indexsubitem for file attributes correctly. 1998-02-17 02:11:21 +00:00
Fred Drake 83bd081920 Minor stuff:
Explain what happens when a negative shift count is used (what exception).

Mark the title "Python Reference Manual" as \emph{}, for consistency.

"info" --> "information"

Tell more about the data attributes of file objects, using the {datadesc}
environment.

When refering the user to the language reference for information about
internal types, tell what internal types to expect information on.
1998-02-13 20:59:25 +00:00
Fred Drake 1947991c2f Remove all \bcode / \ecode cruft; this is no longer needed. See previous
checkin of myformat.sty.

Change "\renewcommand{\indexsubitem}{(...)}" to "\setindexsubitem{(...)}"
everywhere.

Some other minor nits that I happened to come across.
1998-02-13 06:58:54 +00:00
Fred Drake 41785fb864 Do the right magic to make \ABC{} get sorted correctly in the index. 1998-02-09 20:16:46 +00:00
Guido van Rossum 8083c176a3 Add a note about rounding up of readlines()' sizehint to 8K. 1998-02-08 22:51:09 +00:00
Guido van Rossum 7570669a08 Add a note explaining that multiplying a sequence with a negative
number is the same as multiplying it with zero, and yields an empty
sequence.
1998-01-27 19:09:43 +00:00
Fred Drake 73a973bf8d Always mark variables in the "Notes" following a table the same way as in the
tables:  \var{}

Add a couple of index entries to the File Objects section.
1998-01-20 05:20:39 +00:00
Fred Drake 6b3ed7f581 Markup consistency in the mapping object interface description. 1998-01-09 20:36:44 +00:00
Guido van Rossum eb0f066fb8 Correct small nits reported by Rob Hooft. 1997-12-30 20:38:16 +00:00
Guido van Rossum e903aab833 Replace unprotected tilders by \~ -- an unprotected tilde is a
non-breaking space!
1997-12-18 16:28:56 +00:00
Fred Drake 8274f32a6d Fixed index references to modules.
Changed regex reference to re.
1997-12-15 22:19:46 +00:00
Fred Drake 120ac20c40 Remove superfluous comman from between "not" and "in" when describing the
"not in" operator.
1997-10-13 20:48:17 +00:00
Barry Warsaw dc0f00ad03 Document the mapping object's new get() method. 1997-10-06 17:50:48 +00:00
Guido van Rossum 6c9db41d30 Added fileno(); added readlines(sizehint).
AMK's sed job.
1997-07-17 16:05:47 +00:00
Guido van Rossum 3a0d850160 Added complex numbers (AMK).
Clarify that sort() works in-place.
Renamed dict.absorb() to dict.update().
1997-06-02 17:18:00 +00:00
Guido van Rossum 6102b51f2b Added copy() and absorb(). 1997-05-28 19:32:11 +00:00
Fred Drake 4bf1296e05 (libtypes.tex): Correct reversal of two words in description of
formatting strings.
1996-10-11 16:33:48 +00:00
Guido van Rossum 1dde7b737c Typos detected by Sjoerd 1996-10-11 15:57:17 +00:00
Guido van Rossum 316a430098 Removed some spurios biindex calls.
Added description of file.truncate().
Added warning to write() about buffering.
1996-05-02 15:28:53 +00:00
Jack Jansen 4518577b24 Fixed incorrect tex-code for readline 1995-08-14 13:38:36 +00:00
Guido van Rossum 0dbd1fd46e correct description of integer division; describe optional read arg 1995-08-10 14:22:39 +00:00
Guido van Rossum 95a5b9c949 correct description of list.insert() 1995-07-07 23:03:07 +00:00
Guido van Rossum 96628a90c4 typos, layout and other small things 1995-04-10 11:34:00 +00:00
Guido van Rossum ecde781dd1 restructured library manual accordiung to functional group 1995-03-28 13:35:14 +00:00