> How about something like:
> 
> >>> def t1(*argv):
> ...     value = 0
> ...     for n in argv:
> ...         value *= 1_000
> ...         value += n
> ...     return value
> 
> >>> t1(123, 456, 789)
> 123456789
> 
> Similarly, for define t2 to use 1_000_000, t3 to use 1_000_000_000 and so on, 
> instead of 1_000. For really big numbers, you might want to use t10.
> 
> I think something like
> >>> t10(
> ...     111_222_333_444_555_666_777_888_999_000,
> ...     111_222_333_444_555_666_777_888_999_000,
> ...     111_222_333_444_555_666_777_888_999_000,
> ... )
> gives a nice representation of a 90 digit number.

I think everyone on this thread thought this way once, but this way is a bother.
If you want to type a very long number, we may code like this in Jonathans 
proposal.

>>> t1(3, 826, 393, 629, 472, 794, 629, 263, 026, 302...
3826393629472794629263026302...

But if you noticed that you did typo in very last argument(=low digit), you 
need to remove and add commas.
This is really a burden.

In this respect, I'd agree with making new syntax.

> Finally, perhaps really big numbers should be stored as data, rather than 
> placed in source code files. (For example, this would allow these large 
> pieces of data to be verified, via a secure hash.)

As your thought, I think big numbers like MBytes should be stored as data, but 
how about big constant or something like that?
I believe those kind of numbers should be stored in some python files like 
constants.py .

Yamato Nagata
----------------
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/QA67PEWGWKE2QFCVPOXQFNU2U3RBL6RQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to