classification
Title: Arguments to various types not specified in types module
Type: behavior Stage:
Components: Documentation Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eric.araujo, michael.foord, noufal
Priority: normal Keywords:

Created on 2011-02-08 13:09 by noufal, last changed 2011-02-08 22:52 by eric.araujo.

Messages (3)
msg128175 - (view) Author: Noufal (noufal) Date: 2011-02-08 13:09
The documentation for the types module seems to have an obvious bug. The arguments to create the various types are not mentioned in the docs page on http://docs.python.org/library/types.html

This came to my attention from a stack overflow question here
http://stackoverflow.com/questions/4933325/where-can-i-find-documentation-for-calling-the-various-types-in-pythons-types-mo
msg128176 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2011-02-08 13:16
Care to provide a patch Noufal?
msg128197 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-02-08 22:52
Remember that the types module is mostly obsolete now: a type like IntType is described as alias for the builtin int, with a link to the comprehensive document of said int.

(On an unrelated note, the types module may encourage type-checking, which is not common or generally useful in Python.  Too bad it couldn’t be removed wholesale in 3.x.)

That said, adding documentation for other cases like ModuleType and CodeType that aren’t defined anywhere else in the stdlib is indeed a good idea.
History
Date User Action Args
2011-02-08 22:52:33eric.araujosetnosy: + eric.araujo

messages: + msg128197
versions: + Python 3.1, Python 3.2, Python 3.3
2011-02-08 13:16:52michael.foordsetnosy: + michael.foord
messages: + msg128176
2011-02-08 13:09:55noufalcreate