[Python-bugs-list] [Bug #115615] atof, atoi, atol not behaving as methods

noreply@sourceforge.net noreply@sourceforge.net
Thu, 28 Sep 2000 15:02:46 -0700


Bug #115615, was updated on 2000-Sep-28 14:31
Here is a current snapshot of the bug.

Project: Python
Category: Library
Status: Closed
Resolution: Wont Fix
Bug Group: None
Priority: 5
Summary: atof, atoi, atol  not behaving as methods

Details: Similar to lower(),  upper() etc shouldn't atof(),  atoi(),  atol()  behave as methods on the new String
objects?
------------------------------
Python 2.0b2 (#6, Sep 26 2000, 14:59:21) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.

>>> "23".atoi()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
AttributeError: atoi
--------------------------------
similarly for atof(), atol()


Follow-Ups:

Date: 2000-Sep-28 15:02
By: bwarsaw

Comment:
No.  When we were designing the string methods, we decided not to include atof(), atoi(), and atol() since the built-ins int(), long(), and float() now do everything those functions did and they should be used instead.

You'll notice that for backwards compatibility, string.atof(), string.atoi(), and string.atol() are defined in terms of the respective builtins.
-------------------------------------------------------

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=115615&group_id=5470