Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Serhiy Storchaka
08.12.18 03:17, jf...@ms4.hinet.net пише: 00 0 03 File "", line 1 03 ^ SyntaxError: invalid token In Python 3.8 the error message will be more informative: 03 File "", line 1 SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for o

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Henrik Bengtsson
A comment from the sideline: one could imagine extending the Python syntax with a (optional) 0d prefix that allows for explicit specification of decimal values. They would "complete" the family: * 0b: binary number * 0o: octal number * 0d: decimal number * 0x: hexadecimal number I understand that

RE: Why Python don't accept 03 as a number?

2018-12-07 Thread Avi Gross
[[READERS DIGEST CONDENSED ANSWER: use int("string") ]] Since we all agree python will not make notations like "05" work indefinitely, and the need expressed is how to solve a symbolic puzzle (see message below) then it makes sense to look at alternate representations. I have a question first. Ho

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Cameron Simpson
On 07Dec2018 20:24, Jach Fong wrote: Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: What is it exactly that you're trying to accomplish with this? Perhaps there's a better way than using eval. This problem comes from solving a word puzzle, ab + aa + cd == ce Each character will be translate to a

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread jfong
I can understand the difficulty of throwing old thing away and accept new one in human. There seems have a huge inertia there. This phenomenon appears on every aspects, not only on the transition from Python2 to Python3. But, as a new comer of Python like me, I have no difficulty to accept it be

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread jfong
Ian at 2018/12/8 UTC+8 AM11:28:34 wrote: > What is it exactly that you're trying to accomplish with this? Perhaps > there's a better way than using eval. This problem comes from solving a word puzzle, ab + aa + cd == ce Each character will be translate to a digit and evaluate the correctness,

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread MRAB
On 2018-12-08 03:49, Joe Pfeiffer wrote: jf...@ms4.hinet.net writes: MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: Before Python 3, a leading 0 in an integer literal would indicate an octal (base 8) number. So, the reason is historical. The old form is now invalid in order to reduce the chance

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Joe Pfeiffer
jf...@ms4.hinet.net writes: > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: >> Before Python 3, a leading 0 in an integer literal would indicate an >> octal (base 8) number. > > So, the reason is historical. > >> The old form is now invalid in order to reduce the chance of bugs. > > I encounter this

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Ian Kelly
On Fri, Dec 7, 2018 at 7:47 PM wrote: > > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > > Before Python 3, a leading 0 in an integer literal would indicate an > > octal (base 8) number. > > So, the reason is historical. > > > The old form is now invalid in order to reduce the chance of bugs. > > I e

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Chris Angelico
On Sat, Dec 8, 2018 at 1:46 PM wrote: > > MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > > Before Python 3, a leading 0 in an integer literal would indicate an > > octal (base 8) number. > > So, the reason is historical. > > > The old form is now invalid in order to reduce the chance of bugs. > > I e

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread jfong
MRAB at 2018/12/8 UTC+8 AM10:04:51 wrote: > Before Python 3, a leading 0 in an integer literal would indicate an > octal (base 8) number. So, the reason is historical. > The old form is now invalid in order to reduce the chance of bugs. I encounter this problem on trying to do something like th

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread MRAB
On 2018-12-08 01:17, jf...@ms4.hinet.net wrote: 00 0 03 File "", line 1 03 ^ SyntaxError: invalid token Any particular reason? Before Python 3, a leading 0 in an integer literal would indicate an octal (base 8) number. In Python 2.7: >>> 010 8 That notation was borrowed

Re: Why Python don't accept 03 as a number?

2018-12-07 Thread Paulo da Silva
Às 01:17 de 08/12/18, jf...@ms4.hinet.net escreveu: 00 > 0 03 > File "", line 1 > 03 > ^ > SyntaxError: invalid token > > Any particular reason? > Not sure but I think that after 0 it expects x for hexadecimal, o for octal, b for binary, ... may be others. 0xa 10 0o10

Why Python don't accept 03 as a number?

2018-12-07 Thread jfong
>>> 00 0 >>> 03 File "", line 1 03 ^ SyntaxError: invalid token >>> Any particular reason? -- https://mail.python.org/mailman/listinfo/python-list

Focusing on the simple things, KISS, what to use for testing

2018-12-07 Thread Morten W. Petersen
Hi there. I blogged a bit today, about my surveil project and activity on this mailing list: """ This morning the internet became unavailable, after also being unavailable this weekend for several days. So I decided to take a look at my demo board which does surveillance with a webcam using the

Re: tkinter resizable text with grid

2018-12-07 Thread Paulo da Silva
Às 07:11 de 07/12/18, Christian Gollwitzer escreveu: > Am 07.12.18 um 03:00 schrieb Paulo da Silva: >> Às 21:15 de 06/12/18, Rick Johnson escreveu:  ... > So instead of complaining about lacking support in Tk, the > Python community should do their homework and provide wrappers to the > most c

EuroPython 2019: Venue and location selected

2018-12-07 Thread M.-A. Lemburg
After a very work intense RFP with more than 40 venues competing, 17 entries, and two rounds of refinements, we are now happy to announce the winner: EuroPython 2019 will be held in Basel, Switzerland, from July 8 - 14 2019 We will now start work on the contracts