[Python-bugs-list] [ python-Feature Requests-481961 ] Add atoi/atof to string class

noreply@sourceforge.net noreply@sourceforge.net
Sun, 17 Mar 2002 19:43:32 -0800


Feature Requests item #481961, was opened at 2001-11-14 23:04
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=481961&group_id=5470

>Category: Python Interpreter Core
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Thomas Justin Shaw (justinshaw)
>Assigned to: Tim Peters (tim_one)
Summary: Add atoi/atof to string class

Initial Comment:
Just as you can call split() and strip() either from 
the string module or as a string method, it would be 
nice to be able to to the same for atoi() and atof().

Example:
# Current implementation
numStr = '3.14159'
intStr = '2'
pi     = string.atof(numbStr)
two    = string.atio(intStr)

# Proposed implementation
pi  = '3.14159'.atof()
two = '2'.atoi()

Please keep churning out the great work!
Justin Shaw


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-03-17 22:43

Message:
Logged In: YES 
user_id=31435

I like int("2") a lot better myself <wink>.  Closing as 
requested.

----------------------------------------------------------------------

Comment By: Thomas Justin Shaw (justinshaw)
Date: 2002-03-17 22:09

Message:
Logged In: YES 
user_id=135558

Skip this ... I like int("2") better.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=481961&group_id=5470