[Python-checkins] r86295 - in python/branches/release27-maint: Doc/library/stdtypes.rst

mark.dickinson python-checkins at python.org
Sun Nov 7 13:52:19 CET 2010


Author: mark.dickinson
Date: Sun Nov 7 13:52:19 2010
New Revision: 86295
Log:
Merged revisions 86293 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
 r86293 | mark.dickinson | 2010年11月07日 12:48:18 +0000 (2010年11月07日) | 1 line
 
 Issue #10145: the float.is_integer method was undocumented.
........
Modified:
 python/branches/release27-maint/ (props changed)
 python/branches/release27-maint/Doc/library/stdtypes.rst
Modified: python/branches/release27-maint/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/release27-maint/Doc/library/stdtypes.rst	(original)
+++ python/branches/release27-maint/Doc/library/stdtypes.rst	Sun Nov 7 13:52:19 2010
@@ -495,12 +495,24 @@
 
 .. method:: float.as_integer_ratio()
 
- Return a pair of integers whose ratio is exactly equal to the
- original float and with a positive denominator. Raises
- :exc:`OverflowError` on infinities and a :exc:`ValueError` on
- NaNs.
+ Return a pair of integers whose ratio is exactly equal to the
+ original float and with a positive denominator. Raises
+ :exc:`OverflowError` on infinities and a :exc:`ValueError` on
+ NaNs.
 
- .. versionadded:: 2.6
+ .. versionadded:: 2.6
+
+.. method:: float.is_integer()
+
+ Return ``True`` if the float instance is finite with integral
+ value, and ``False`` otherwise::
+
+ >>> (-2.0).is_integer()
+ True
+ >>> (3.2).is_integer()
+ False
+
+ .. versionadded:: 2.6
 
 Two methods support conversion to
 and from hexadecimal strings. Since Python's floats are stored


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /