[Python-ideas] Re: Really long ints

2020-02-06 Thread Jonathan Fine
I thank Dominik Vilsmeier for noticing >>> 001 SyntaxError: invalid token This is a problem both the original poster's suggestion: >>> P = 100\ ...000\ ... 000 and mine: >>> t1( 100, 000, 000) That '001' is a syntax error interests me. I'll start a new thread for that. -- Jonathan __

[Python-ideas] Re: Really long ints

2020-02-06 Thread Chris Angelico
On Thu, Feb 6, 2020 at 10:35 PM Jonathan Fine wrote: > > I thank Dominik Vilsmeier for noticing > >>> 001 > SyntaxError: invalid token > > This is a problem both the original poster's suggestion: > > >>> P = 100\ > ...000\ > ... 000 > > and mine: > > >>> t1( 100, 000, 000) > > That '001' is a

[Python-ideas] Perhaps allow leading zeroes in integer literals

2020-02-06 Thread Jonathan Fine
SUMMARY = It was once a good idea, for Python 3 to forbid leading zeroes in integer literals. Since then circumstances have changed. Perhaps it's now, or soon will be, a good time to permit this. A SURPRISE == I was surprised by: >>> 0 0 >>> 00 0 >>> 000 0 >>> 001 SyntaxError: in

[Python-ideas] Re: Really long ints

2020-02-06 Thread Jonathan Fine
On Thu, Feb 6, 2020 at 11:58 AM Chris Angelico wrote: That's a simple matter of history. > > Python 2.7.13 (default, Sep 26 2018, 18:42:22) > [GCC 6.3.0 20170516] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> 0100 > 64 > > In C and its friends and family

[Python-ideas] Re: Perhaps allow leading zeroes in integer literals

2020-02-06 Thread Chris Angelico
On Thu, Feb 6, 2020 at 11:07 PM Jonathan Fine wrote: > > SUMMARY > = > > It was once a good idea, for Python 3 to forbid leading zeroes in integer > literals. Since then circumstances have changed. Perhaps it's now, or soon > will be, a good time to permit this. > > So what's happening?

[Python-ideas] Re: Perhaps allow leading zeroes in integer literals

2020-02-06 Thread Serhiy Storchaka
06.02.20 14:03, Jonathan Fine пише: >>> 001 SyntaxError: invalid token The error message was improved in the latest Python: 001 File "", line 1 SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers 1. It was good to remove from Py

[Python-ideas] Re: Perhaps allow leading zeroes in integer literals

2020-02-06 Thread Andrew Barnert via Python-ideas
On Feb 6, 2020, at 04:06, Jonathan Fine wrote: > > A NEWBY GOTCHA > > > A standard way of writing today's date is 2020-02-06. Let's try this in > Python, first with Christmas Day, and then for today: > > >>> datetime.date(2020, 12, 25) > datetime.date(2020, 12, 25) > >>> datet