Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect len #40489

Closed
calvinlow mannequin opened this issue Jul 1, 2004 · 2 comments
Closed

incorrect len #40489

calvinlow mannequin opened this issue Jul 1, 2004 · 2 comments

Comments

@calvinlow
Copy link
Mannequin

calvinlow mannequin commented Jul 1, 2004

BPO 983269

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2004-07-01.10:03:17.000>
created_at = <Date 2004-07-01.08:53:53.000>
labels = ['expert-regex']
title = 'incorrect len'
updated_at = <Date 2004-07-01.10:03:17.000>
user = 'https://bugs.python.org/calvinlow'

bugs.python.org fields:

activity = <Date 2004-07-01.10:03:17.000>
actor = 'effbot'
assignee = 'effbot'
closed = True
closed_date = None
closer = None
components = ['Regular Expressions']
creation = <Date 2004-07-01.08:53:53.000>
creator = 'calvinlow'
dependencies = []
files = []
hgrepos = []
issue_num = 983269
keywords = []
message_count = 2.0
messages = ['21363', '21364']
nosy_count = 2.0
nosy_names = ['effbot', 'calvinlow']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue983269'
versions = ['Python 2.3']

@calvinlow
Copy link
Mannequin Author

calvinlow mannequin commented Jul 1, 2004

a=12345678901
len(`a`) returns 12.

notice that the the length of a numeric value after 10
digits is actually + 1

@calvinlow calvinlow mannequin closed this as completed Jul 1, 2004
@calvinlow calvinlow mannequin assigned effbot Jul 1, 2004
@calvinlow calvinlow mannequin added the topic-regex label Jul 1, 2004
@effbot
Copy link
Mannequin

effbot mannequin commented Jul 1, 2004

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants