list and implicit continuation may cause bugs in Python programs
Roman Suzi
rnd at onego.ru
Thu Jul 12 13:11:47 EDT 2001
On Thu, 12 Jul 2001, Andreas Jung wrote:
>
>----- Original Message -----
>From: "Roman Suzi" <rnd at onego.ru>
>To: <python-list at python.org>
>Sent: Donnerstag, 12. Juli 2001 09:00
>Subject: list and implicit continuation may cause bugs in Python programs
>
>
>> FYI:
>>
>> Do not forget commas:
>>
>> list =[ "update", "y", "m", "d", "y1", "m1", "d1", "event", "url",
>> "preview" ]
>>
>> list =[ "update", "y", "m", "d", "y1", "m1", "d1", "event", "url"
>> "preview" ]
>>
>> Or Python will silently make:
>> ['update', 'y', 'm', 'd', 'y1', 'm1', 'd1', 'event', 'urlpreview']
>>
>> Does PyChecker check for these kind of things?
>>
>
>For what reason should it check ? Both is valid Python code. In the second
>case 'url' and 'preview' are concatenated. This is dedicated behaviour.
>
>Also the following is correct Python code:
>
>print "url" "preview"
>print "url","preview"
>
>So there is no way to determine the programmers intention at this point.
PyChecker is about determining ambiguity, like lint
will give you warnings about
if (a=b) { };
in C code.
Sincerely yours, Roman Suzi
--
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Thursday, July 12, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Misfortune: The kind of fortune that never misses." _/
More information about the Python-list
mailing list