This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: incorrect len
Type: Stage:
Components: Regular Expressions Versions: Python 2.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: effbot Nosy List: calvinlow, effbot
Priority: normal Keywords:

Created on 2004-07-01 08:53 by calvinlow, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21363 - (view) Author: calvinlow (calvinlow) Date: 2004-07-01 08:53
a=12345678901
len(`a`) returns 12.

notice that the the length of a numeric value after 10
digits is actually + 1
msg21364 - (view) Author: Fredrik Lundh (effbot) * (Python committer) Date: 2004-07-01 10:03
Logged In: YES 
user_id=38376

12345678901 is a long integer; `x` and repr(x) of long 
integers includes the trailing "L":

>>> a = 12345678901
>>> print repr(a)
12345678901L

to get just the digits, use str(x).  see the docs for more 
information on long integers and repr vs. str.

History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40489
2004-07-01 08:53:53calvinlowcreate