Re: [Tutor] pychecker: x is None or x == None

2005-08-13 Thread Alan G
>if x == None: >do_something() > > but then someone thought that we should really change these to > >if x is None: >do_something() > > However. if you run pychecker on these two snippets of code, it > complains about the second, and not the first: Personally I'd use if

Re: [Tutor] pychecker: x is None or x == None

2005-08-12 Thread Kent Johnson
Duncan Gibson wrote: > We've been programming in Python for about a year. Initially we had a > lot of tests of the form > > if x == None: > do_something() > > but then someone thought that we should really change these to > > if x is None: > do_something() > > However. i

[Tutor] pychecker: x is None or x == None

2005-08-12 Thread Duncan Gibson
We've been programming in Python for about a year. Initially we had a lot of tests of the form if x == None: do_something() but then someone thought that we should really change these to if x is None: do_something() However. if you run pychecker on these two snippets of

Re: [Tutor] PyChecker: Installing and or Using

2005-08-11 Thread Dick Moores
Kent Johnson wrote at 05:31 8/11/2005: >According to the docs importing pychecker only checks modules that are >imported *after* the module containing the import. If you have a >single-file program try using pychecker from the command line. > >When you insert errors as a test, of course you have

Re: [Tutor] PyChecker: Installing and or Using

2005-08-11 Thread Kent Johnson
Dick Moores wrote: > But how do I move on? All I get is the above warning. > > For example, I put "import pychecker.checker" at the top of mycalc.py, my > collection of functions. Does getting only that warning mean that > mycalc.py has no problems? I've tried inserting some obvious errors, but

Re: [Tutor] PyChecker: Installing and or Using

2005-08-11 Thread Dick Moores
Kent Johnson wrote at 04:55 8/11/2005: >Dick Moores wrote: > > It appears to me that I've found a bug in PyChecker (see below). Am I > > correct? > > Warning (from warnings module): > > File "C:\Python24\lib\site-packages\pychecker\checker.py", line 609 > > m = imp.init_builtin(moduleName

Re: [Tutor] PyChecker: Installing and or Using

2005-08-11 Thread Kent Johnson
Dick Moores wrote: > It appears to me that I've found a bug in PyChecker (see below). Am I > correct? > Warning (from warnings module): > File "C:\Python24\lib\site-packages\pychecker\checker.py", line 609 > m = imp.init_builtin(moduleName) > DeprecationWarning: the regex module is depre

Re: [Tutor] PyChecker: Installing and or Using

2005-08-10 Thread Dick Moores
It appears to me that I've found a bug in PyChecker (see below). Am I correct? Dick Resending my last post: Kent Johnson wrote at 06:13 8/9/2005: >Dick Moores wrote: > > Win XP. Python2.4. > > > > Javier Ruere suggested getting PyChecker or PyLint. I found PyChecker > and > > put the pych

Re: [Tutor] PyChecker: Installing and or Using

2005-08-09 Thread Dick Moores
Kent Johnson wrote at 06:13 8/9/2005: >Dick Moores wrote: > > Win XP. Python2.4. > > > > Javier Ruere suggested getting PyChecker or PyLint. I found PyChecker > and > > put the pychecker-0.8.14 folder in > > C:\Python24\Lib\site-packages\PyChecker. I don't really know what I'm > > doing (obviously

Re: [Tutor] PyChecker: Installing and or Using

2005-08-09 Thread Kent Johnson
Dick Moores wrote: > Win XP. Python2.4. > > Javier Ruere suggested getting PyChecker or PyLint. I found PyChecker and > put the pychecker-0.8.14 folder in > C:\Python24\Lib\site-packages\PyChecker. I don't really know what I'm > doing (obviously?), but I added > C:\Python24\Lib\site-packages\P

[Tutor] PyChecker: Installing and or Using

2005-08-09 Thread Dick Moores
Win XP. Python2.4. Javier Ruere suggested getting PyChecker or PyLint. I found PyChecker and put the pychecker-0.8.14 folder in C:\Python24\Lib\site-packages\PyChecker. I don't really know what I'm doing (obviously?), but I added C:\Python24\Lib\site-packages\PyChecker\pychecker-0.8.14\pycheck

Re: [Tutor] Pychecker

2005-04-22 Thread Mike Hansen
Thanks Danny. I'll make sure I use pychecker so I don't shoot myself in the foot with not so easy to catch typos in variable names and syntax blunders. I might check with the pychecker devs to see if there's any effort to get it put into the standard distribution. I think it's too handy to not h

Re: [Tutor] Pychecker

2005-04-22 Thread Danny Yoo
On Fri, 22 Apr 2005, Danny Yoo wrote: > > > In Perl, you can perl -c somehardtoreadperlprogram.pl that will just > > check the syntax. The above problem would have been caught in Perl > > since I always use strict. Is there a command line option in Python to > > do a Pychecker-like syntax check?

Re: [Tutor] Pychecker

2005-04-22 Thread Danny Yoo
> In Perl, you can perl -c somehardtoreadperlprogram.pl that will just > check the syntax. The above problem would have been caught in Perl since > I always use strict. Is there a command line option in Python to do a > Pychecker-like syntax check? Hi Mike, Unfortunately, no, because there are s

[Tutor] Pychecker

2005-04-22 Thread Mike Hansen
I had a frustrating time yesterday with a small Python program I wrote. I wasn't getting the results I expected, so I sprinkled print statements through it. I wasn't getting anywhere. I tossed it into Komodo to see if the background syntax checker would pick up something I was missing. I then st