[ python-Bugs-983269 ] incorrect len
SourceForge.net
noreply at sourceforge.net
Thu Jul 1 06:03:17 EDT 2004
Bugs item #983269, was opened at 2004-07-01 10:53
Message generated for change (Comment added) made by effbot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=983269&group_id=5470
Category: Regular Expressions
Group: Python 2.3
>Status: Deleted
>Resolution: Rejected
Priority: 5
Submitted By: calvinlow (calvinlow)
Assigned to: Fredrik Lundh (effbot)
Summary: incorrect len
Initial Comment:
a=12345678901
len(`a`) returns 12.
notice that the the length of a numeric value after 10
digits is actually + 1
----------------------------------------------------------------------
>Comment By: Fredrik Lundh (effbot)
Date: 2004-07-01 12:03
Message:
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=983269&group_id=5470
More information about the Python-bugs-list
mailing list