greg <g...@cosc.canterbury.ac.nz> 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 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 you describe, the
case needs to be made separately that digit concatenation should not be
consistent with the established string literal parsing behaviour.

-- 
 \        “What if the Hokey Pokey IS what it's all about?” —anonymous |
  `\                                                                   |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to