[pypy-svn] r16360 - pypy/dist/pypy/objspace/std
lac at codespeak.net
lac at codespeak.net
Wed Aug 24 12:57:42 CEST 2005
Author: lac
Date: Wed Aug 24 12:57:39 2005
New Revision: 16360
Modified:
pypy/dist/pypy/objspace/std/booltype.py
pypy/dist/pypy/objspace/std/dicttype.py
pypy/dist/pypy/objspace/std/floattype.py
pypy/dist/pypy/objspace/std/inttype.py
pypy/dist/pypy/objspace/std/listtype.py
pypy/dist/pypy/objspace/std/longtype.py
pypy/dist/pypy/objspace/std/objecttype.py
pypy/dist/pypy/objspace/std/slicetype.py
pypy/dist/pypy/objspace/std/tupletype.py
Log:
And these are the files that the getdocstring tool correctly inserted a docstring into
Modified: pypy/dist/pypy/objspace/std/booltype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/booltype.py (original)
+++ pypy/dist/pypy/objspace/std/booltype.py Wed Aug 24 12:57:39 2005
@@ -13,6 +13,11 @@
# ____________________________________________________________
bool_typedef = StdTypeDef("bool", int_typedef,
+ __doc__ = '''bool(x) -> bool
+
+Returns True when the argument x is true, False otherwise.
+The builtins True and False are the only two instances of the class bool.
+The class bool is a subclass of the class int, and cannot be subclassed.''',
__new__ = newmethod(descr__new__),
)
bool_typedef.acceptable_as_base_class = False
Modified: pypy/dist/pypy/objspace/std/dicttype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/dicttype.py (original)
+++ pypy/dist/pypy/objspace/std/dicttype.py Wed Aug 24 12:57:39 2005
@@ -106,6 +106,15 @@
# ____________________________________________________________
dict_typedef = StdTypeDef("dict",
+ __doc__ = '''dict() -> new empty dictionary.
+dict(mapping) -> new dictionary initialized from a mapping object's
+ (key, value) pairs.
+dict(seq) -> new dictionary initialized as if via:
+ d = {}
+ for k, v in seq:
+ d[k] = v
+dict(**kwargs) -> new dictionary initialized with the name=value pairs
+ in the keyword argument list. For example: dict(one=1, two=2)''',
__new__ = newmethod(descr__new__,
unwrap_spec=[gateway.ObjSpace,gateway.W_Root,gateway.Arguments]),
)
Modified: pypy/dist/pypy/objspace/std/floattype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/floattype.py (original)
+++ pypy/dist/pypy/objspace/std/floattype.py Wed Aug 24 12:57:39 2005
@@ -42,5 +42,8 @@
# ____________________________________________________________
float_typedef = StdTypeDef("float",
+ __doc__ = '''float(x) -> floating point number
+
+Convert a string or number to a floating point number, if possible.''',
__new__ = newmethod(descr__new__),
)
Modified: pypy/dist/pypy/objspace/std/inttype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/inttype.py (original)
+++ pypy/dist/pypy/objspace/std/inttype.py Wed Aug 24 12:57:39 2005
@@ -89,5 +89,13 @@
# ____________________________________________________________
int_typedef = StdTypeDef("int",
+ __doc__ = '''int(x[, base]) -> integer
+
+Convert a string or number to an integer, if possible. A floating point
+argument will be truncated towards zero (this does not include a string
+representation of a floating point number!) When converting a string, use
+the optional base. It is an error to supply a base when converting a
+non-string. If the argument is outside the integer range a long object
+will be returned instead.''',
__new__ = newmethod(descr__new__),
)
Modified: pypy/dist/pypy/objspace/std/listtype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/listtype.py (original)
+++ pypy/dist/pypy/objspace/std/listtype.py Wed Aug 24 12:57:39 2005
@@ -41,6 +41,8 @@
# ____________________________________________________________
list_typedef = StdTypeDef("list",
+ __doc__ = '''list() -> new list
+list(sequence) -> new list initialized from sequence's items''',
__new__ = newmethod(descr__new__, unwrap_spec=[gateway.ObjSpace,
gateway.W_Root,
gateway.Arguments]),
Modified: pypy/dist/pypy/objspace/std/longtype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/longtype.py (original)
+++ pypy/dist/pypy/objspace/std/longtype.py Wed Aug 24 12:57:39 2005
@@ -73,5 +73,12 @@
# ____________________________________________________________
long_typedef = StdTypeDef("long",
+ __doc__ = '''long(x[, base]) -> integer
+
+Convert a string or number to a long integer, if possible. A floating
+point argument will be truncated towards zero (this does not include a
+string representation of a floating point number!) When converting a
+string, use the optional base. It is an error to supply a base when
+converting a non-string.''',
__new__ = newmethod(descr__new__),
)
Modified: pypy/dist/pypy/objspace/std/objecttype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/objecttype.py (original)
+++ pypy/dist/pypy/objspace/std/objecttype.py Wed Aug 24 12:57:39 2005
@@ -158,6 +158,7 @@
__str__ = gateway.interp2app(descr__str__),
__repr__ = gateway.interp2app(descr__repr__),
__class__ = GetSetProperty(descr__class__, descr_set___class__),
+ __doc__ = '''The most base type''',
__new__ = newmethod(descr__new__,
unwrap_spec = [gateway.ObjSpace,gateway.W_Root,gateway.Arguments]),
__hash__ = gateway.interp2app(descr__hash__),
Modified: pypy/dist/pypy/objspace/std/slicetype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/slicetype.py (original)
+++ pypy/dist/pypy/objspace/std/slicetype.py Wed Aug 24 12:57:39 2005
@@ -136,6 +136,9 @@
slice_typedef = StdTypeDef("slice",
+ __doc__ = '''slice([start,] stop[, step])
+
+Create a slice object. This is used for extended slicing (e.g. a[0:10:2]).''',
__new__ = newmethod(descr__new__),
start = slicewprop('w_start'),
stop = slicewprop('w_stop'),
Modified: pypy/dist/pypy/objspace/std/tupletype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/tupletype.py (original)
+++ pypy/dist/pypy/objspace/std/tupletype.py Wed Aug 24 12:57:39 2005
@@ -17,5 +17,9 @@
# ____________________________________________________________
tuple_typedef = StdTypeDef("tuple",
+ __doc__ = '''tuple() -> an empty tuple
+tuple(sequence) -> tuple initialized from sequence's items
+
+If the argument is a tuple, the return value is the same object.''',
__new__ = newmethod(descr__new__),
)
More information about the Pypy-commit
mailing list