[code-quality] Variable declarations + pyflakes

Raphael Clifford drraph at gmail.com
Mon May 27 15:09:35 CEST 2013


The email below was sent before it was finished.

     var foo = 15
     [...]
     var foo = 10

 should return an error.


   foo = 15

should return an error if foo was not declared before.

The second answer of
http://programmers.stackexchange.com/questions/15468/what-are-the-drawbacks-of-python
 (with 60 votes) has some more details of a very similar suggestion.

Is it possible for use pyflakes with some suitably defined annotation
to do something equivalent? Getting python devs to accept the
suggestion for the core python language more not be at all plausible.

Raphael



On 27 May 2013 14:05, Raphael Clifford <drraph at gmail.com> wrote:
> I have recently been talking to friends/colleagues about their reasons
> for not using python for large projects (say from a thousand lines of
> code and with at least three people contributing). One of the problems
> that comes up time and again is the difficulty in debugging python
> code and in particular the simple sounding job of catching typos.  One
> specific suggestion is the following.
>
> Make variable declaration compulsory.   For example.
>
>     var foo = 15
>     [...]
>     var foo = 10
>
> should return an error.
>
>
> Similarly


More information about the code-quality mailing list