Re: From D
- From: "mensanator@xxxxxxx" <mensanator@xxxxxxx>
- Date: Thu, 26 Jul 2007 11:02:26 -0700
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
.
- Follow-Ups:
- Re: From D
- From: Ben Finney
- Re: From D
- References:
- From D
- From: bearophileHUGS
- Re: From D
- From: Stargaming
- Re: From D
- From: Bjoern Schliessmann
- Re: From D
- From: Steven D'Aprano
- Re: From D
- From: mensanator@xxxxxxx
- Re: From D
- From: Ben Finney
- Re: From D
- From: mensanator@xxxxxxx
- Re: From D
- From: Steven D'Aprano
- Re: From D
- From: mensanator@xxxxxxx
- Re: From D
- From: Ben Finney
- From D
- Prev by Date: Re: Any reason why cStringIO in 2.5 behaves different from 2.4?
- Next by Date: Re: From D
- Previous by thread: Re: From D
- Next by thread: Re: From D
- Index(es):
Relevant Pages
|