Re: Help with syntax warnings



Peter Hansen wrote:

> Wow... Python detects "dubious syntax"? And here I thought programming
> was rather black and white, it's right or it's wrong.

SyntaxWarnings are issued for things that has never been valid nor well-
defined nor especially clever, but has been handled (in some more or less
reasonable way) by the CPython compiler. In practice, syntax warnings
will turn into errors in future releases.

> (He notes examples such as assigning to None and "unqualified exec is
> not allowed in function" etc.)

Compare and contrast:

Python 2.3.4 (#53, May 25 2004, 21:17:02)
>>> None = "hello"
<stdin>:1: SyntaxWarning: assignment to None

Python 2.4.1 (#65, Mar 30 2005, 09:13:57)
>>> None = "hello"
SyntaxError: assignment to None

</F>



.



Relevant Pages

  • Inserting rows syntax + row #ing code in protected sheet?
    ... The syntax to put basically at beginning and end of a macro that's assigned ... didn't realize that the insert function is gone once a sheet is protected ... then assigning a message box macro to it to say "unprotect the sheet to ... insert rows, then protect again" if worse came to worst, but I feel that ...
    (microsoft.public.excel.programming)
  • Re: Getting value from asp:label into javascript input value
    ... In regular asp the syntax for assigning an asp global variable to a ... javascript var is: ... Prev by Date: ...
    (comp.lang.javascript)
  • Add attribute - apparently I have to
    ... I have the following line of code in a code-behind file. ... Am I not assigning to the property with the line I'm using??? ... and they all seem to indicate using the syntax above. ... Haydn ...
    (microsoft.public.dotnet.framework.aspnet)
  • Select Count question
    ... What is the syntax for assigning the returned value ... where callhold is the sql statement and counted is the variable I want the ...
    (microsoft.public.vb.database.ado)
  • Re: Whats the best language to learn...
    ... on processors designed to run Lisp and Lisp OSes. ... sence that the language make effective use of them. ... No other programming language can do what lisp can do. ... is exactly because of its syntax. ...
    (comp.programming)