Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread greg
Ben Finney wrote: So, different representations of literals are parsed as separate literals, then concatenated. To have the behaviour you describe, the case needs to be made separately that digit concatenation should not be consistent with the established string literal parsing behaviour. I th

Re: Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-24 Thread Steven D'Aprano
On Mon, 24 Aug 2009 12:45:25 +1000, Ben Finney wrote: > greg writes: > >> J. Cliff Dyer wrote: >> >> > What happens if you use a literal like 0x10f 304? >> >> To me the obvious thing to do is concatenate them textually and then >> treat the whole thing as a single numeric literal. Anything else

Re: Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-24 Thread Carl Banks
On Aug 23, 7:45 pm, Ben Finney wrote: > greg writes: > > J. Cliff Dyer wrote: > > > > What happens if you use a literal like 0x10f 304? > > > To me the obvious thing to do is concatenate them textually and then > > treat the whole thing as a single numeric literal. Anything else > > wouldn't be s

Re: Literal concatenation, strings vs. numbers

2009-08-24 Thread Erik Max Francis
Ben Finney wrote: Yet, as was pointed out, that behaviour would be inconsistent with the concatenation of string literals:: >>> "abc" r'def' u"ghi" 'jkl' u'abcdefghijkl' So, different representations of literals are parsed as separate literals, then concatenated. To have the behaviour y

Literal concatenation, strings vs. numbers (was: Numeric literals in other than base 10 - was Annoying octal notation)

2009-08-23 Thread Ben Finney
greg writes: > J. Cliff Dyer wrote: > > > What happens if you use a literal like 0x10f 304? > > To me the obvious thing to do is concatenate them textually and then > treat the whole thing as a single numeric literal. Anything else > wouldn't be sane, IMO. Yet, as was pointed out, that behaviour