473,386 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Adding more warnings

I tend to make a lot of mistakes of misspelled variable names.

Is it possible to make python warn me about those at "compile time"?

Very few times I use dynamic variable initialization. I can live with
getting a warning for those as well.

--
Best Regards,
Med Venlig Hilsen,
Thomas

Feb 20 '08 #1
1 971
Thomas Dybdahl Ahle <lo****@gmail.comwrites:
I tend to make a lot of mistakes of misspelled variable names.
You would greatly benefit from using tools like 'pyflakes', 'pylint',
and a unit test suite for your code. They're very good for finding
such simple bugs in your code.
Is it possible to make python warn me about those at "compile time"?
The names are resolved at run time, so the compiler has insufficient
information to say whether a name is used incorrectly.

--
\ "Program testing can be a very effective way to show the |
`\ presence of bugs, but is hopelessly inadequate for showing |
_o__) their absence." -- Edsger Dijkstra |
Ben Finney
Feb 20 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Kylotan | last post by:
I have the following code: def IntToRandFloat(x): """Given a 32-bit integer, return a float in """ x = int(x) x = int(x << 13) ^ x return...
3
by: Dennis Hotson | last post by:
I'm having trouble adding a file to a .zip file using python2.3. The write method of a ZipFile object needs a filename in order to add a file to the archive. The problem is that I want to add a...
3
by: Terry Richards | last post by:
mysql 4.1.9-standard how do i find exactly what the warnings are when i only get Query OK, 1 row affected, 1 warning (0.00 sec) :-)^2
3
by: graeme_smith77 | last post by:
Hi all, very new to web design in general and Javacript in particular. I found.... http://www.peterkerr.freeserve.co.uk/mouseover/html.html and used the mouseover example to add some changing...
30
by: prasanna | last post by:
i will be very thankful if you sent all the errors and warnings regarding to the language C thank you
22
by: John Fisher | last post by:
void f(int p) { } Many (most?) compilers will report that p is unreferenced here. This may not be a problem as f may have to match some common prototype. Typically pointers to functions are...
6
by: pete142 | last post by:
When I compile this code: typedef unsigned char BYTE; BYTE * IpString(unsigned int ip) { static BYTE ipString; ipString = (BYTE) 0xff & (ip >24); ipString = (BYTE) 0xff & (ip >16);
3
by: gil | last post by:
Hi, I'm trying to find the best way to work with compiler warnings. I'd like to remove *all* warnings from the code, and playing around with the warning level, I've noticed that compiling with...
1
by: billiejoex | last post by:
Hi there, into a module of mine I 'warn' a message if a certain situation occurs: def add_anonymous_user(permissions=('r'): if 'w' in p: import warnings warnings.warn("it's not rencommended...
1
by: Robert Singer | last post by:
Platform: winXP, excel 2003 Python 2.5.2 XLWriter 0.4a3 (http://sourceforge.net/projects/pyxlwriter/) Is anyone here using this very nice package, for writing excel files? I'm using it on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.