[Tutor] making a string

Steven D'Aprano steve at pearwood.info
Mon May 27 03:06:35 CEST 2013


On 27/05/13 10:43, Jim Mooney wrote:
> On 26 May 2013 17:38, eryksun <eryksun at gmail.com> wrote:
>> On Sun, May 26, 2013 at 8:20 PM, Steven D'Aprano <steve at pearwood.info> wrote:
>>> On 27/05/13 07:40, Jim Mooney wrote:
>>>
>>>> Good to know that compile doesn't check syntax, since I erroneously
>>>> thought it did.
>>>
>>> compile does check syntax.
>>
>> Attempting to iterate an integer is a runtime TypeError, not a
>> compile-time SyntaxError.
>
> Ah, that clears it up.


Like most dynamic languages, Python's compiler checks very few things at compile time. In general, there is little that Python *can* check, not without actually running the code, so even when when Python *could* detect an error at compile time, it usually doesn't bother because the programming effort is too high for the benefit.



-- 
Steven


More information about the Tutor mailing list