Re: From D



On Jul 26, 1:24 am, Ben Finney <bignose+hates-s...@xxxxxxxxxxxxxxx>
wrote:
"mensana...@xxxxxxx" <mensana...@xxxxxxx> writes:
On Jul 25, 9:04?pm, Steven D'Aprano
<st...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Why does it make no sense? Have you never had to scrape a web page
or read a CSV file?

Again, unrelated to the way the Python compiler syntactically treats
the source code.

That's what I was enquiring about.

So, just as

>>> int('123' '456')
123456

is not an error, the proposal is that

>>> a = 123 456
SyntaxError: invalid syntax

will not be an error either.

Yet,

>>> a = int('123 456')
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
a = int('123 456')
ValueError: invalid literal for int() with base 10: '123 456'

will still be an error. Just trying to be clear on this. Wouldn't
want that syntax behavior to carry over into run-time.


So this proposal would only apply to string literals at compile
time, not running programs?

Exactly the same way that it works for string literals in source code:
once the source code is compiled, the literal is indistinguishable
from the same value written a different way.

And I want the same error to occur if my CSV parser tries to convert
'123 456' into a single number. I don't want it to assume the
number is '123456'.

Once again, this is a discussion about Python syntax, not the
behaviour of the csv module.

Who said I was using the csv module?


--
\ "I always had a repulsive need to be something more than |
`\ human." -- David Bowie |
_o__) |
Ben Finney


.



Relevant Pages

  • Re: Export Member from a Security Group
    ... Excellent, i tried adfind to export the members of a security group, to ... a excel CSV or .txt file. ... i also figured out the syntax to export the ...
    (microsoft.public.win2000.active_directory)
  • Re: Parsing s-expression trees
    ... expressions --> lisp. ... the irregularity in its often cited regular syntax. ... programers can pretty much tell what piece of source code ... Lisp relies on a regular nested syntax. ...
    (comp.lang.lisp)
  • Re: JQuery button problem
    ... Look at the source -- they add identifier to the containing scope, and when you see what the Java source code comment above Scope, it describes something quite different than scope in ECMAScript. ... The source code for google's javascript typically relies very heavily on error correction and interpretation of syntax errors where FunctionDeclaration production appears only where statements are allowed. ... optimizations, and even generated documentation. ...
    (comp.lang.javascript)
  • Re: When is Xah going to ease up on Emacs...
    ... Fundamental Problems of Lisp ... However, the lisp syntax has ... it allows transformation of the source code by a simple ... what this means is that lisp's lists is ...
    (comp.lang.lisp)
  • Re: When is a function not a function?
    ... You are wrong: the minimum required syntax for pragma reader is: ... // some source code ... The code you have originally posted simply leads to the "syntax error" ...
    (comp.lang.javascript)